By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,612 Members | 1,632 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,612 IT Pros & Developers. It's quick & easy.

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

P: 2
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:

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
Sep 25 '07 #1
Share this Question
Share on Google+
3 Replies


P: 2
...........................
Sep 26 '07 #2

P: 2
DID YOU EVER FIGURE THIS OUT. I need to do the same thing and need help
Nov 13 '07 #3

10K+
P: 13,264
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?
Nov 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.