Hi PHP community. I have a PHP script on Linux (CentOS 5.2) which produces a "failed to open stream: No such file or directory" which I am out of ideas on how to solve. I am on the verge of reverting to Perl.
The line generating the code is: $fh2 = fopen($fname,"rb") or die("can't open file");
When I replace $fname with actual file name it works. I have tried enclosing in single quotes, apostrophe, with path, without path, running as root and setting promiscuous permissions to no avail.
Here's actual output from the script and output of ls:
[hamid@grandma]$ php ./stripper.php
PHP Warning: fopen(/home/hamid/Outdoor2008-2_200A.csv
): failed to open stream: No such file or directory in /home/hamid/stripper.php on line 28
Warning: fopen(/home/hamid/Outdoor2008-2_200A.csv
): failed to open stream: No such file or directory in /home/hamid/stripper.php on line 28
[hamid@grandma]$
[hamid@grandma aurora]$ ls -l /home/hamid/Outdoor2008-2_200A.csv
-rwxrwxrwx 1 hamid apache 47264 Apr 11 19:18 /home/hamid/Outdoor2008-2_200A.csv
Any help will be greatly appreciated.
Thanks,
Hamid.