Announcement

Collapse
No announcement yet.

PHP and Cron Job

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP and Cron Job

    I have a php script that I'm trying to setup and I don't know the correct cron command to run a php script. Can you help me out with this. I have been using this:

    command:

    php -1 /home/jobfromh/public_html/directoryname/scriptname.php

    Error I'm getting:

    Error in argument 1, char 2: option not found 1
    Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>]
    php <file> [args...]
    -a Run interactively
    -C Do not chdir to the script's directory
    -c <path>|<file> Look for php.ini file in this directory
    -n No php.ini file will be used
    -d foo[=bar] Define INI entry foo with value 'bar'
    -e Generate extended information for debugger/profiler
    -f <file> Parse <file>. Implies `-q'
    -h This help
    -i PHP information
    -l Syntax check only (lint)
    -m Show compiled in modules
    -q Quiet-mode. Suppress HTTP Header output.
    -s Display colour syntax highlighted source.
    -v Version number
    -w Display source with stripped comments and whitespace.
    -z <file> Load Zend extension <file>.

    Thanks, Lisa
    Nevada Gal

    Want an online business? Watch my Webomercial
    Small & Medium Sized businesses - get more clients, build referrals, advertise & create tournaments in your own Golf Game. Powerful solution tailored to meet your needs - Watch my Business Only Webomercial
    Play a round of Golf on me, just for the fun of it!

  • #2
    Re: PHP and Cron Job

    Try

    cd '/home/username/public_html/directoryname/'; php -q 'scriptname.php' > /dev/null
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment


    • #3
      Re: PHP and Cron Job

      I took your suggestion but now I'm getting this emailed to me:

      No log handling enabled - turning on stderr logging
      read_config_store open failure on /var/net-snmp/snmpapp.conf
      read_config_store open failure on /var/net-snmp/snmpapp.conf
      read_config_store open failure on /var/net-snmp/snmpapp.conf

      If I wasn't confused before I'm totally spinning now!

      Thanks, Lisa

      P.S. I put the line in "exactly" like you had it inserting my path and php script file.
      Nevada Gal

      Want an online business? Watch my Webomercial
      Small & Medium Sized businesses - get more clients, build referrals, advertise & create tournaments in your own Golf Game. Powerful solution tailored to meet your needs - Watch my Business Only Webomercial
      Play a round of Golf on me, just for the fun of it!

      Comment


      • #4
        Re: PHP and Cron Job

        Try using


        GET http://www.yoursite.com/file_to_run_with_cron.php > /dev/null

        Register/Login Script
        Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

        Comment


        • #5
          Re: PHP and Cron Job

          It doesn't seem that it is the cron job that you can't get to work, but the script itself.
          Navaldesign
          Logger Lite: Low Cost, Customizable, multifeatured Login script
          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

          Comment

          Working...
          X