![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Noob, script formatting query | benjo | Shell Programming and Scripting | 2 | 03-03-2008 03:37 AM |
| Why does my script not work? (Noob Alert) | bronkeydain | Shell Programming and Scripting | 4 | 02-21-2008 12:45 PM |
| Crontab a Script | moutaz1983 | Shell Programming and Scripting | 6 | 01-16-2008 06:35 AM |
| noob. need help to create a script. | aron | Shell Programming and Scripting | 1 | 07-09-2007 05:13 PM |
| how can i use crontab in a script? | DebianJ | Shell Programming and Scripting | 1 | 05-05-2005 06:24 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Using PHP script with crontab (NOOB)
Hi, I am trying to use a PHP script as a test for a cron job.
My crontab is 1 line: 30 * * * * /home/www/inc/crontab.php if I test the file through the browser (ie. http://www.domain.com/inc/crontab.php), the PHP script works -- so there is nothing wrong with the PHP script itself or the path. I aked my hosting admin for assistance and the error he keeps getting is: /bin/sh: line 1: /home/www/inc/crontab.php: Permission denied What permission do I need to set to get it to work??? |
| Forum Sponsor | ||
|
|
|
|||
|
What about this (adjust path to php executable below)?
30 * * * * /usr/bin/php /home/www/inc/crontab.php Note that your host may not necessarily have the php executable installed if it is just meant to run as a module to Apache. Only you (or your host admin) will know how the PHP is configured. In that case, you will not be able to run PHP scripts on the command line. By the way the following works for me: a.php: #!/usr/bin/php <?php phpinfo() ?> chmod +x a.php ./a.php So you probably may do it too. |
|
|||
|
30 * * * * wget -O /dev/null http://www.domain.com/inc/crontab.php
could always try something like this... |
|||
| Google UNIX.COM |