Jump to content

fopen access problem with permissions


Eric!

Recommended Posts

I'm trying to open a file that I don't want the permisions open to the world.

 

$file=fopen('test.txt','r') or die("Can't open file");

 

This generates an error if the READ permission for WORLD is not set (644).  Is there a way my host provider can set the php process so that it is in my group so I can keep the read permissions set just for the USER and GROUP (640)?

 

I've requested they put the process into my group, but it seems they are unable to fix this problem.  Can someone explain to me what has to be changed on the apache server to put the php process into my group so I can ask my host to fix it?  Or is this not usually done?

 

Thanks,

Eric

Link to comment
https://forums.phpfreaks.com/topic/121129-fopen-access-problem-with-permissions/
Share on other sites

I'm using cpanel as well, however the problem is the servers process that is running the php script does not belong to my access group (I'm assuming this is the problem).  Shouldn't I be able to write a script that can open a file with 640 permisions?  I think there is something wrong with my host's configuration of my account, but I've tried to get them to fix it and they can't seem to be able to find the problem.  So I'm looking for someone who might have some detailed infomration about this who can help me solve it for them.

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.