ID: 45333
User updated by: omikorn at yahoo dot com
Reported By: omikorn at yahoo dot com
Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: CentOS5
PHP Version: 4.4.8
New Comment:
include_path=".:.:" in php.ini
Previous Comments:
------------------------------------------------------------------------
[2008-06-23 00:38:03] omikorn at yahoo dot com
Description:
------------
I have a cron script that is run on 2 different machines like this:
1st machine has php 4.3.9 installed.
2nd machine has php 4.4.8 installed.
Script is ran from cron on both machines like this:
/usr/bin/php /var/www/vhosts/whatever.com/httpdocs/script.php
script.php contains the following section:
$filename="./mailfile/dailyreport.txt";
$fp=fopen($filename,"r");
if ($fp) {
echo "file found";
} else {
echo "file not found"
}
When script is ran from php 4.3.9 box it works fine but from 4.4.8 it
returns a file not found error over $fp.
Reproduce code:
---------------
$filename="./mailfile/dailyreport.txt";
$fp=fopen($filename,"r");
if ($fp) {
echo "file found";
} else {
echo "file not found"
}
Expected result:
----------------
Script to behave like in php 4.3.9
Actual result:
--------------
$fp returns FALSE and a file not found error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45333&edit=1