I have a php file on my NGINIX(with php-fpm) that create a simple txt file.
<?php
$content = "some text here 123 myText.txt";
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");
fwrite($fp,$content);
fclose($fp);
?>
But this works only when I give my "www" folder 777 Permission. My Index.php is placed in my www folder.
What is wrong with my user settings on nginix and php-fpm?
After i give ownership of my www folder to my nginx user (as defined in /etc/nginx/nginx.conf
), it works!
chown -R www-data:www-data www
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With