1

Possible Duplicate:
What are the best linux permissions to use for my website?

When I trying upload file with PHP to a folder that folder should have 777 permission, but this is a security risk, I want set 755 for folder permission but in this permission PHP cannot upload files.

What should I do ?

Server: Linux CentOS

Control Panel : Kloxo

Root Access : Yes

MajAfy
  • 107

1 Answers1

1

You can simply change the owner of the upload folder to be apache user using:

$ sudo chown apache_user /path/to/upload/folder

Of course, you need to know the user your web server is running as.

If you want to share the folder between multiple users, you can change the group and grant the group the appropriate permissions.

Khaled
  • 37,789