fopen problem

Reply

Join Date: Jul 2008
Posts: 25
Reputation: darkmikey is an unknown quantity at this point 
Solved Threads: 1
darkmikey darkmikey is offline Offline
Light Poster

fopen problem

 
0
  #1
May 29th, 2009
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:
  1. Warning: fopen(test.jpg) [function.fopen]: failed to open stream: Permission denied in <long path> on line 5
From this call:
  1. $File = "test.jpg";
  2. $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
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: fopen problem

 
0
  #2
May 31st, 2009
Yes, it is a permission problem. You need to chmod the the in question.

http://en.wikipedia.org/wiki/Chmod

Or if the problem is ownership, chwon:

http://en.wikipedia.org/wiki/Chown
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 25
Reputation: darkmikey is an unknown quantity at this point 
Solved Threads: 1
darkmikey darkmikey is offline Offline
Light Poster

Re: fopen problem

 
0
  #3
May 31st, 2009
I was under the impression that Chmod and Chown are unix system commands, and that windows does not have them?
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: fopen problem

 
0
  #4
May 31st, 2009
Originally Posted by darkmikey View Post
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.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC