Connecting Tech Pros Worldwide Forums | Help | Site Map

Need help to make a php script to work via cron...

Newbie
 
Join Date: Sep 2007
Posts: 2
#1: Sep 25 '07
I don't know how to make a php script to work via cron...I want to make it run daily...My server API is CGI/Fast CGI.I have hosting from godaddy and in the help section i found that i have to specify the interpreter manually...look what it says:

Quote:
The Command field is the script or executable that runs at a specified frequency. Click Browse to locate a file in your hosting account. The full file name of your selection is placed into this editable field.

Cron commands are typically script files that have executable permission and specify their interpreter as the first line of the file. For example, a first line of "#!/usr/bin/perl" directs the system to run the perl language interpreter for the file.

Your Shared Hosting account supports the following languages and associated interpreter lines:

* Perl: #!/usr/bin/perl
* Python 2.2: #!/usr/bin/python2.2
* Python 2.3: #!/usr/bin/python2.3
* Python 2.4: #!/usr/bin/python2.4
* Ruby: #!/usr/local/bin/ruby
* Bash: #!/bin/bash

The installed versions of PHP 4 and PHP 5 do not support the interpreter specification in a PHP file. In order to run a PHP script via Cron, you must specify the interpreter manually. For example:

* PHP 4: /web/cgi-bin/php "$HOME/html/test.php
* PHP 5: /web/cgi-bin/php5 "$HOME/html/test.php5
i've tried with /web/cgi-bin/php "$HOME/html/path/to/my/script.php as command and it doesn't work.

if i run the script in browser it works...what should i introduce as a command..and do i have to add something in my php script??please help me...
Edit/Delete Message

Newbie
 
Join Date: Sep 2007
Posts: 2
#2: Sep 26 '07

re: Need help to make a php script to work via cron...


...........................
Newbie
 
Join Date: Nov 2007
Posts: 2
#3: Nov 13 '07

re: Need help to make a php script to work via cron...


DID YOU EVER FIGURE THIS OUT. I need to do the same thing and need help
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#4: Nov 13 '07

re: Need help to make a php script to work via cron...


Quote:

Originally Posted by DLUKE

DID YOU EVER FIGURE THIS OUT. I need to do the same thing and need help

What have you tried? Did you get any error/warning?
Reply