Install apache2 , php7 on a dedicated server. I manually created the file 1.txt and try to write data to it - file_put_contents("1.txt", data); .. but gives an error:
PHP Warning: file_put_contents(1.txt): failed to open stream: Permission denied in /var/www/html/1.php on line 3 also fails to create file via php
ls -l :
-rw-r--r-- 1 webuser webuser 65 окт 17 15:53 1.php -rw-r--r-- 1 webuser webuser 0 окт 17 15:55 1.txt As you can see the rights are 644 .
How to solve this problem?? Does this mean that I have to issue 777 permissions to the files?
I look at a hosting, files with the rights 644 are created there, and it is easily edited through php
please clarify
1.txtmust be writable, and read and write permissions are required. - mix644rights do not give write access to the owner? - cmd