homepage Welcome to WebmasterWorld Guest from 54.225.57.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Cron Job to execute PHP script?
How to do it on unix?
hbirnbaum




msg:1255337
 1:01 pm on Dec 14, 2004 (gmt 0)

I have a PHP script I want to execute automatically once a month. I was thinking Chron job. But, I am not sure of the unix command to execute a script. Can it be the URL of the script I want to execite? How do I set this up in cPanel?

 

jamie




msg:1255338
 1:17 pm on Dec 14, 2004 (gmt 0)

if you have php installed as a cgi [es.php.net], then you can call it as you would another cron job.

if not then you could use lynx - try this post for more info:
[webmasterworld.com...]

re: cpanel - i don't. sorry.

p.s. if you search these forums you'll find plenty of references to php and cron.

good luck

dmorison




msg:1255339
 6:17 pm on Dec 14, 2004 (gmt 0)

If you don't have the PHP cgi installed you can use wget to run a PHP script via cron.

The command is simply:

wget -O /dev/null [example.com...]

The -O /dev/null part means send the output to the null device so that no disk space is taken up with the HTML (or whatever) output from your script.

Slade




msg:1255340
 8:15 pm on Dec 14, 2004 (gmt 0)

In the X skin for Cpanel, there is a Cron Jobs tab near the bottom of the main page of icons. I expect it is available in other skins, but it might be one level further in.

dreamcatcher




msg:1255341
 1:32 am on Dec 15, 2004 (gmt 0)

In cpanel the following will also work:

php -q /home/serverpath/script/file.php

Note that -q is seperated by spaces.

There are also some threads on the cpanel forum about settings up cron jobs.

dc

hbirnbaum




msg:1255342
 12:46 pm on Dec 15, 2004 (gmt 0)

Thanks guys! I appreciate all the info...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved