Protected chmod privileges?

The standard chmod privileges are "644" for files and "755" for directories, right?

In most cases, PHP does not need to write to files or directories. So, can I take write permissions from all groups?

I could assign "444" to all files and "555" to all directories.

Wouldn't it be safer?

Thanks in advance!

Note: chmod()is on my PHP list disable_functions.

+5
source share
4 answers

The default permissions for newly created files and directories are set by the umask environment variable . The file owner and root can change permissions.

chmod , . : chmod . , .

, , , . , . - , ... reset / .

, - , , . "" , .

- , . php-. "". :

  • - , , .
  • .
  • .
  • - .
  • .

, - , ? , , . , , , , xss. php- . - , . - , . , javascript. , / .

+3

, PHP chmod 777 000-chmoded ( PHP). , , , chmoding .

+1

.

.

  • safe_mod php.ini, safe_mod , , .
  • plesk, , , plesk.
  • , php.
+1

chmod() PHP disable_functions.
?

disable_functions .
chmod() disable_functions, ; , PHP-, chmod(), .

The directive disable_functionsshould not be confused with the Safe Mode directives . disable_functionsactive even if the directive is safe_modeset to 0; when safe_modeenabled, some features are disabled or limited.

To notice that safe mode is deprecated, in PHP 5.3; this means that the directive is still accepted in PHP 5.3, but it could not be used at any time.

0
source

All Articles