473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
3 2318
uzzi
2
...........................
Sep 26 '07 #2
DLUKE
2
DID YOU EVER FIGURE THIS OUT. I need to do the same thing and need help
Nov 13 '07 #3
r035198x
13,262 8TB
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

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

Similar topics

2
by: Christoph | last post by:
Hi, I wrote a php script, which calls with the system-command the commandline tool "transcode". transcode is a tool to convert audio and video files in different codecs. When I call the...
5
by: deko | last post by:
In regard to running php scripts with cron - Here is a sample script: <?php //debug.php echo "<br> This is a test"; ?> I can call debug.php from a web page on my site like this:
2
by: volantecho | last post by:
hi, i m using webmin to create a cron job of a php script. While i click on 'run it now', it works, generate the output. However, the php script doesnt execute for every minutes which i've set...
1
by: av_nagar | last post by:
hello - I would like to know how do i work with php in windows tasks. i developed a php web application and i would like to recieve to my email every day a certain report which will be...
3
by: dburdick | last post by:
I was referred to this forum as this may be a php specific problem. Some kind of configuration problem maybe. I have some php files that connect to a mysql database and are run as cron jobs. ...
15
by: Bob Bedford | last post by:
Hi all, I'm having troubles with my hosting and for a few reasons I can't change. So here is my problem: I receive XML files with images included in the file. I've to parse the file, save datas...
2
by: erikcw | last post by:
Hi all, When trying to run this python script from cron, I get the following error: Traceback (most recent call last): File "/home/lybp/public_html/wa/wa.py", line 14, in ? import MySQLdb...
5
by: scriptee | last post by:
Hi , I wan to run a php script using cron on my host server. Its a Linux based server and I am allowed to use cron. I want to run a php script with includes. I tried some suggestions which...
0
by: Alen192 | last post by:
i have create this simple script i bash that modify the crontab's user's file with an option passed by standard input, now i would know if is possible create a similar script with php so i can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.