Jump to content

fopen denied permission


rubing

Recommended Posts

I get a permission denied warning when trying to write a file to disk using fopen, however fopen is enabled.  I think this comes down to permissions.  My suid and guid for php is 1000, however my directories on my server are all owned by a user 4096.  Do I have to create a common group for php and the user??

 

Alternatively making all folders readable and writeable seems insecure and dangerous.

Link to comment
https://forums.phpfreaks.com/topic/129093-fopen-denied-permission/
Share on other sites

shouldn't php run as root?

 

No, Apache starts as root but quickly switches to a non privelleged user. its this user which needs to be able to write to your directories / files.

 

Seems a wierd setup if Apache is running as uid 1000, numbers that high are normally reserved for actual users.

 

Oh, and roots id is always 1.

sorry i got it a little backwards....here is my user info:

 

uid=1000(bob) gid=1000(bob) groups=1000(bob)

 

and php gives the same uid=1000, gid=1000

 

the directory i am trying to write to is listed as follows:

 

drwxr-xr-x 2 bob bob 4096 Oct 19 00:43 played

 

 

,so there really shouldn't be a problem, right??

 

However I get the following error: 

 

Warning: fopen(../public/played/e_santiago.mp3) [function.fopen]: failed to open stream: Permission denied in /home/bob/public_html/citymusicnow.com/private/lib_php/merge_mp3.inc on line 481

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.