Re: [PHP] PHP in crontab job
Ühel ilusal päeval [11-10-2002 20:48] kirjutas Sharat Hegde: Hello John, Thanks for the help. I was able to solve this. Thanks Marek for your help too in giving the same solution. The problem was with the crontab command not having the full path to php. Silly that a command line on the shell script should work but crontab is unable to find the same path. This is not silly, the cron simply does not have the environment variables set. If you are using vixie cron, you can set the environment within the crontab ie: PATH=/bin:/usr/bin [EMAIL PROTECTED] * * * * * man cron Cheers, Juhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP in crontab job
Hello, I am having a problem at my ISP relating to execution of PHP commands from the crontab command. My ISP told me to have a look at the following URL, but despite following these instructions, the crontab job is not being executed. http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ The crontab command line works from the shell prompt and I am able to execute the php command from the command line as well as the lynx command - no problems with that. Any ideas on how to get the crontab to execute the PHP commands? Regards, Sharat _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in crontab job
On Fri, 11 Oct 2002, Sharat Hegde wrote: -Hello, - -I am having a problem at my ISP relating to execution of PHP commands from -the crontab command. My ISP told me to have a look at the following URL, but -despite following these instructions, the crontab job is not being executed. -http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ - -The crontab command line works from the shell prompt and I am able to -execute the php command from the command line as well as the lynx command - -no problems with that. - -Any ideas on how to get the crontab to execute the PHP commands? Ensure you have specified the php program in the first line, I am sure you did this but here is how I do it. #!/usr/local/bin/php -q Make sure it is a fully specified pathname to the php executable. Crontab all too often does not have knowledge of your path environment so may get lost if you just say php. Make sure you really do have a php executable. This is what will compile if you do not specify any configuration directives during the ./configure process. Tell us how you do. - -Regards, -Sharat - - -_ -Join the worlds largest e-mail service with MSN Hotmail. -http://www.hotmail.com - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in crontab job
try using full path in your cron job, like * * * * * /usr/local/bin/php /path/to/your/cron.php Sharat Hegde wrote: Hello, I am having a problem at my ISP relating to execution of PHP commands from the crontab command. My ISP told me to have a look at the following URL, but despite following these instructions, the crontab job is not being executed. http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ The crontab command line works from the shell prompt and I am able to execute the php command from the command line as well as the lynx command - no problems with that. Any ideas on how to get the crontab to execute the PHP commands? Regards, Sharat _ Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in crontab job
Hello John, Thanks for the help. I was able to solve this. Thanks Marek for your help too in giving the same solution. The problem was with the crontab command not having the full path to php. Silly that a command line on the shell script should work but crontab is unable to find the same path. Thanks again, Sharat From: John S. Huggins [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] PHP in crontab job Date: Fri, 11 Oct 2002 15:35:41 + (UTC) On Fri, 11 Oct 2002, Sharat Hegde wrote: -Hello, - -I am having a problem at my ISP relating to execution of PHP commands from -the crontab command. My ISP told me to have a look at the following URL, but -despite following these instructions, the crontab job is not being executed. -http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ - -The crontab command line works from the shell prompt and I am able to -execute the php command from the command line as well as the lynx command - -no problems with that. - -Any ideas on how to get the crontab to execute the PHP commands? Ensure you have specified the php program in the first line, I am sure you did this but here is how I do it. #!/usr/local/bin/php -q Make sure it is a fully specified pathname to the php executable. Crontab all too often does not have knowledge of your path environment so may get lost if you just say php. Make sure you really do have a php executable. This is what will compile if you do not specify any configuration directives during the ./configure process. Tell us how you do. - -Regards, -Sharat - - -_ -Join the worlds largest e-mail service with MSN Hotmail. -http://www.hotmail.com - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP in crontab job
The problem is crontab doesn't heve enviroment, there is no $PATH, $USER ... Sharat Hegde wrote: Hello John, Thanks for the help. I was able to solve this. Thanks Marek for your help too in giving the same solution. The problem was with the crontab command not having the full path to php. Silly that a command line on the shell script should work but crontab is unable to find the same path. Thanks again, Sharat From: John S. Huggins [EMAIL PROTECTED] To: Sharat Hegde [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] PHP in crontab job Date: Fri, 11 Oct 2002 15:35:41 + (UTC) On Fri, 11 Oct 2002, Sharat Hegde wrote: -Hello, - -I am having a problem at my ISP relating to execution of PHP commands from -the crontab command. My ISP told me to have a look at the following URL, but -despite following these instructions, the crontab job is not being executed. -http://www.htmlcenter.com/tutorials/tutorials.cfm/155/PHP/ - -The crontab command line works from the shell prompt and I am able to -execute the php command from the command line as well as the lynx command - -no problems with that. - -Any ideas on how to get the crontab to execute the PHP commands? Ensure you have specified the php program in the first line, I am sure you did this but here is how I do it. #!/usr/local/bin/php -q Make sure it is a fully specified pathname to the php executable. Crontab all too often does not have knowledge of your path environment so may get lost if you just say php. Make sure you really do have a php executable. This is what will compile if you do not specify any configuration directives during the ./configure process. Tell us how you do. - -Regards, -Sharat - - -_ -Join the world?s largest e-mail service with MSN Hotmail. -http://www.hotmail.com - - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, visit: http://www.php.net/unsub.php - ** John Huggins VANet [EMAIL PROTECTED] http://www.va.net/ ** _ Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php