Jump to content

PHP file permissions


Eric!

Recommended Posts

Does anyone know how the PHP processes access local files for reading and writing?  I can not make my scripts work with 640.  Is there a way so that the world read setting are closed, but read is open to the user and group (640)?  The error I get with 640 (but not with 644 permissions) is:

 

Warning: fopen(test_file.txt) [function.fopen]: failed to open stream: Permission denied in /update_try.php on line 12

 

Also I can't get any of the PHP scripts to create a file without getting the following error (the directory and parent directories are set to 755):

 

Warning: fopen(tempfile9685.htm) [function.fopen]: failed to open stream: Permission denied in /update_try.php on line 55

 

The code is very simple: $fh = fopen($filename, "w");

 

Is there something wrong with how the groups/permissions are setup?

 

Link to comment
https://forums.phpfreaks.com/topic/121728-php-file-permissions/
Share on other sites

So I need to get my shared host to put the process into my group.  How would I make this request specifically to them?  Do the php processes have a specific name that I can tell them to include into my group?

 

By the way, I've tried chown and several other php tricks to try to change owners or permissions and all of them are denied access.  Also the only way I can get PHP to write to a file is by setting the directory to 777, which seems like a bad idea.  Or am I just paranoid?

Link to comment
https://forums.phpfreaks.com/topic/121728-php-file-permissions/#findComment-629756
Share on other sites

I'm getting desperate.  Does anyone know what PHP process names need to be added into my group for local server so it can read/write my files?  My host provider doesn't want to take the time to understand my problem and I don't want to open up all my files to the world.  Please help!

Link to comment
https://forums.phpfreaks.com/topic/121728-php-file-permissions/#findComment-632293
Share on other sites

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.