Home >Backend Development >PHP Tutorial >nginx file permissions issue

nginx file permissions issue

PHP中文网
PHP中文网Original
2016-08-31 08:54:521852browse


centos + lnmp
Use PHP to write to the test folder. The permission setting is not 766. It must be 777?

nginx runs as user www, and the folder belongs to user root

Reply content:

centos + lnmp
Use PHP to write to the test folder. The permission setting is not 766, must it be 777?

nginx runs as user www, and the folder belongs to user root

0666 is fine, 0777 just has more execution rights
If you give write and execution permissions at the same time, it should be very dangerous.

The main reason: the directory requires WX permissions, and the file requires W permissions

Please check what is your Nginx user? What is the php user? Does the nginx user have permissions to the directory you want to write?

That’s it nginx file permission issues, please pay attention to the PHP Chinese website (www.php.cn) for more related content!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn