Volatil3
Volatil3

Reputation: 14978

PHP: Unable to figure out reason of fOpen error

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

Upvotes: 0

Views: 752

Answers (3)

jap1968
jap1968

Reputation: 7763

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);

Upvotes: 0

GordonM
GordonM

Reputation: 31730

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.

Upvotes: 0

ThiefMaster
ThiefMaster

Reputation: 318488

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 ;)

Upvotes: 5

Related Questions