Results 1 to 5 of 5

Thread: PHP and Cron Job
      
   

  1. #1
    Nevada Gal's Avatar
    Nevada Gal is offline Private
    Join Date
    Oct 2006
    Posts
    3

    Default 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. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default 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!


  3. #3
    Nevada Gal's Avatar
    Nevada Gal is offline Private
    Join Date
    Oct 2006
    Posts
    3

    Default 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!

  4. #4
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: PHP and Cron Job


    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

  5. #5
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default 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!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49