SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: PHP and CRONO

  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Indiana
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm hosted on a server has an interface for using CRONO and a text box for entering the command to run at a specific time. I've tried several different ways to run a PHP page at a certain time but it hasn't worked. Is there anyone who has a good idea on how to do this?

    Thankful for any suggestions!

  2. #2
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Albany, NY
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    The most common way that people run a php file is through lynx with the following command in a cronjob:

    lynx -dump http://www.yourdomain.com/file.php

    But if the server has a copy of the php binary you can run:

    /usr/bin/php /home/pathtofile/file.php

    Using these commands in a cron job should work, but you may have to specify the path for lynx on the first one.
    John Reyes
    HostRocket.com Support

  3. #3
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Indiana
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply.. I'm sure it should work but for some reason it doesn't...

  4. #4
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Describe the problem with more details, we could stop you from crying
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  5. #5
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Indiana
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well I tried both ways... But wonder if the time Crono use
    and the time I get when using PHP is different? The form
    for using cron has 5 inputboxes...
    mm hh dd mm yy command

    where I enter

    9 05 * * * /usr/bin/php /home/public/autorun.php

    the path to PHP is right and the path to my program is right unless it want just /autorun.php (haven't tried that) so it should work and I wonder if maybe it isn't set up right... and I'm just hosted there, they use cpanel if that's any help...
    Also I wonder if the time is entered in 24 hours? But I'll keep trying... maybe.. some day.... :-)

    Thanks!!

  6. #6
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It looks right to me.
    Try to run the command under telnet/SSH.
    Are you sure that your script path is correct?
    /home/public/autorun.php
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  7. #7
    SitePoint Member
    Join Date
    Mar 2001
    Location
    Indiana
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes it's actually /home/public_html/autorun.php
    gotten from the SCRIPT_FILENAME path. but how would
    I run it from telnet? I don't have much experience with telnet but some... What command would I use?

    Thankful for reply


Bookmarks

Posting Permissions

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