Jump to content

How NOT to Require CHMOD 755 Permissions To Create, Write and Delete Files?


BornKillaz

Recommended Posts

Hi!

 

On my previous server and on some other hosts, I was able to write to files (for example with PHP) without having to chmod the files first.

 

Now I cannot, and files are required to be chmoded properly so I can write to them.

 

I cannot even touch() a file with PHP.

 

Is there any way to have this permissions removed?

 

I don't want to chmod the all thing, all I want is to change the configurations so I can fwrite() or file_put_contents() normally.

 

I's a dedicated un-managed server, so basically any advanced configurations can be done.

 

Please help!  :-\

 

Thank you in advance!

Link to comment
Share on other sites

If I want the server to be able to read and write files I do something like:

 

chown -R user:group /path/to/location
chmod -R ug+rw /path/to/location

 

"group" is the group that you have apache running under.

 

 

 

Hi, and thank you for your fast reply.

 

So, is that the only option? CHMOD?

 

And it is secure? I mean, I have run my code for the last 3 years with no problems on the old server....

 

However I was running PHP as a CGI module. Don't know if has something to do with that.

 

 

 

Link to comment
Share on other sites

If I understand what you are saying, you mean that when you create the files they are not made with proper permissions for you to manipulate(read/write/execute) them?

 

That may be a setting on the server that automatically assigns that privilege, and you may be able to get it changed if you have root access.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.