0
votes

I am getting the following error:

Warning: fopen() [function.fopen]: Unable to access Archive-Report-Sat-Dec-2011 12-12-42.xls/var/www/vhosts/eample.com/httpdocs/_files/Archive-Report-Sat-Dec-2011 12-12-42.xls in /var/www/vhosts/shares-predict.com/httpdocs/include/functions.php on line 194

Warning: fopen(Archive-Report-Sat-Dec-2011 12-12-42.xls/var/www/vhosts/example.com/httpdocs/_files/Archive-Report-Sat-Dec-2011 12-12-42.xls) [function.fopen]: failed to open stream: No such file or directory in /var/www/vhosts/example.com/httpdocs/include/functions.php on line 194

Things were working fine on my local desktop and other remote server but here I am getting error. What could be the issue

3
Likely file permissions or an invalid path.Corbin
Just looking at the errors is not enough, you need to post a code sample. But I see you have a space in you filename, which could be the problem, if you develop say on Windows and your server is Linux, or the other way aroundTomáš Plešek
Spaces in filenames are ugly but allowed on both systems.ThiefMaster

3 Answers

5
votes

Look at the path.. you apparently prefix the path with the filename which is obviously not what you want.

Unless you actually have a path Archive-Report-Sat-Dec-2011 12-12-42.xls/var/www/vhosts/eample.com/httpdocs/_files/ inside your working directory of course ;)

0
votes

It's fairly obvious that the file you're trying to open doesn't exist. I'd suggest echoing out the realpath() of the file path string you're trying to open to make sure it contains what you think it does.

0
votes

Maybe did you mean:

fopen("/var/www/vhosts/example.com/httpdocs/_files/Archive-Report-Sat-Dec-2011/12-12-42.xls");

Instead of:

fopen(Archive-Report-Sat-Dec-2011 12-12-42.xls/var/www/vhosts/example.com/httpdocs/_files/Archive-Report-Sat-Dec-2011 12-12-42.xls);