Hi,

For some reason I can't make fopen work. It worked fine on my server, however upon putting the script on my clients server it started giving this error:

Warning: fopen(test.jpg) [function.fopen]: failed to open stream: Permission denied in <long path> on line 5

From this call:

$File = "test.jpg";
$Handle = fopen($File, 'wb');

According to phpinfo() the server is:
Windows NT B-SERVER-01 5.2 build 3790
PHP Version 4.4.7
And safe mode is off if it makes a difference.

I assume that its something to do with permissions but how do I go about fixing it. I don't really do a lot of php development only small things like this script

Recommended Answers

All 4 Replies

I was under the impression that Chmod and Chown are unix system commands, and that windows does not have them?

I was under the impression that Chmod and Chown are unix system commands, and that windows does not have them?

Usually, it isn't a problem on windows.

Which version of windows?

Make sure the file is not set to read only, or being used by another process (program).

eg: Right click, properties.

Vista has group access control to files similar to unix. Make sure the PHP user can access that file. I don't have much experience with this however.

First of all, you please check your file path that need to open and your access permissions from client side. Then only, it will perfectly works

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.