PHP can open file only with 777 permissions

E1dar :

Have PHP script that log stuff. It's job to open the file (*.txt), write to file and close it.

With 755 permissions on folder nothing works. I get a "Permission denied" error. With 777 permissions on folder, it's working again. What the hell?

I'm using NGINX, 'test' is my user. Folders:

drwxr-xr-x  3 root root 4096 Feb 29 21:16 example.com
  drwxr-xr-x 4 test test 4096 Feb 29 21:57 html    
    -rw-r--r-- 1 test test 13286 Feb 29 22:04 log.txt
    -rw-r--r-- 1 test test  3517 Feb 29 21:57 request.php
E1dar :

PHP running under www-data user. After "chown" to that user, all is worked as it should

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=24351&siteId=1