Results 1 to 3 of 3
Feb 10, 2009, 00:54 #1
Php auto-prepend to crontab files
I have a php value set through httpd.conf that auto-prepends a common function file to every .php page on my site.
I have several .php crontab files that require this common function file to run. However the crontab keeps returning errors to me that the functions can't be found. So I'm assuming the file isn't getting pre-pended when run by the server itself.
does this sound right? Is there a way around this? will I have to go to every crontab file and manually insert
Feb 10, 2009, 01:23 #2
- Join Date
- Jul 2008
- 0 Post(s)
- 0 Thread(s)
Your settings from httpd.conf are applied only when php is run through the webserver. You would need to use wget in your cron job command to fetch the url which will execute your php script.
Otherwise, if you just execute php directly, your executing a potentially completely seperate copy of php which will not have anything to do with your webserver at all. It may be a different version of php, and may use a different php.ini file, and almost certainly has different default config settings.
If you don't use wget, you're essentially running php from the command line interface. You need to read this then
Feb 10, 2009, 10:27 #3
well, I couldn't use wget because my cron scripts are above the root so they have no url. if the were at the root or below they could be accessed by web browsers where they could be executed multiple times.
I think it'll be easiest to just run an include or require () for the functions file each time