PDA

View Full Version : File permissions under phpsuexec


Dave_L
11-12-2007, 02:32 PM
I've been using PHP for quite a while, but have no experience with phpsuexec. I've read the topic "PHP directives on servers with phpsuexec enabled" and I think I understand it, but I have some additional questions about file permissions.

1. .php files directly executed by HTTP request (via URL): Do these need to be executable (755), or only readable (644)?

2. What are the tightest (most restrictive) permissions that will work for the following types of files?

2a. .php files directly executed by HTTP request.

2b. .php files accessed by "include" or "require" in another PHP script.

2c. .html files directly executed by HTTP request.

2d. Other files read by a PHP script.

2e. Other files written by a PHP script.

I've attempted to figure this out by trial and error, but haven't gotten consistent results.

Dave_L
11-13-2007, 08:18 AM
I found this: http://www.cablan.net/phpsuexec.html

According to that article, the answers to my questions are:

1. Only readable.

2a. 600

2b. 600

2c. 644

2d. 400

2e. 600

And 644 and 600 can be changed to 444 and 400 if the files don't need to be writable.

Directories need to be world-executable: 755, or 555 for read-only.