Discuss crontab/PHP problem in the UNIX Help forum on Dev Shed. crontab/PHP problem UNIX Help forum discussing the Unix Operating System and all variants including Irix, Solarix, and AIX. Unix was designed as a true multi-user operating system.
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 173
Time spent in forums: 1 Day 9 m 24 sec
Reputation Power: 11
Nevermind. I had originally posted this problem in the PHP forum because I was getting a different error that seemed more PHP related but now it's resolved.
For anyone w/ the same problem, I just added -f after the php command & now it works!
Posts: 173
Time spent in forums: 1 Day 9 m 24 sec
Reputation Power: 11
Well, it only works from the command line.
It still isn't running from the shell script, though. My host has a Plesk control panel that has a pretty easy interface for setting up cron jobs so I don't know what the problem could be now.
Posts: 5,966
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 188
How about this:
/usr/bin/php -f /httpdocs/admin/storage/testcron.php
Anyways, are you sure php is in /usr/bin? Also, what kind of server is this. If you are on a shared host, your ISP might prevent you from doing this. A chroot() environment may cause problems too because your PHP interpreter may not be present inside.
Maybe this helps:
You can call PHP scripts also indirectly via Apache. In your cron script, start "lynx http://www.domain.tld/cronscript.php > /dev/null"
Posts: 5,966
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 188
Quote:
Originally Posted by shazam-fu
Yeah, I tried that, too, but no dice.
Hmmm. I forgot the question mark, but this was meant as one. An important one: > Also, what kind of server is this?
ISP? Ensim maybe? Which system / control panel?
Posts: 173
Time spent in forums: 1 Day 9 m 24 sec
Reputation Power: 11
The control panel is Plesk. The OS is Linux.
But that's all I know. I'm not sure what type of server it is. I don't have direct access to the host - or even the shell for that matter! I have to call or email someone and tell them exactly what to type in the shell & have them email me the results in order to debug. Or I have to email them a question to ask the host.
It's a crazy way to debug & is taking about 100 times longer than it would if I could just get into the shell myself!
Posts: 5,966
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 188
Never worked with Plesk.
Why I was asking... Maybe your server is running in a chroot environment. You can not access any programs not explicitly allowed by your host.
You can make some tests, eg. find the current path name with getcwd() when running php. If it does not contain any numeric scheme or similar ("/home/user123/htdocs" eg), you are probably in a chroot.
You could try to use the system() and similar functions to locate the php interpreter. eg.
passthru("find / -name php");
But then, maybe you should switch to a more flexible provider...