Referencing files in cron jobs versus format when running from URL
| From: | ioannes | Date: | Sat, 02 Aug 2008 13:13:45 +0000 |
| Subject: | Referencing files in cron jobs versus format when running from URL | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277610@lists.php.net to get a copy of this message | ||
I have a file that works from the URL like:
www.mysite.com/cronjob.php
and this file includes references to uploaded files like this:
/home/mysite/public_html/dir/subdir/filename.xml
and this is used in functions like filemtime(). The uploaded files are found on the server using the above path in the code of the php file.
However, when I cron the php file from the server using:
/ramdisk/bin/php4 -q /home/mysite/public_html/cronjob.php
(using the server cPanel Cron Manager Linux command type set up page), the php file does not find the uploaded files, presumably because the above format of /home/mysite/public_html/dir/subdir/filename.xml needs to be a different path. This must be familiar to many, can you help in suggesting change in path required?
John