我的NGINIX(带有PHP-fpm)上有一个PHP文件,可创建一个简单的txt文件.
<?PHP$content = "some text here 123 myText.txt";$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");fwrite($fp,$content);fclose($fp);?>
<?PHP
$content = "some text here 123 myText.txt";
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");
fwrite($fp,$content);
fclose($fp);
?>
但这仅在我授予“ www”文件夹777许可时有效.我的Index.PHP放在我的www文件夹中.
我在nginix和PHP-fpm上的用户设置有什么问题?
chown -R www-data:www-data www