PHP and Cron Job

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Nevada Gal
    Private

    • Oct 2006
    • 3

    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!
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #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

    • Nevada Gal
      Private

      • Oct 2006
      • 3

      #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

      • Watdaflip
        Major General

        • Sep 2005
        • 2116

        #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

        • navaldesign
          General & Forum Moderator

          • Oct 2005
          • 12080

          #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