无法在PHP(nginx)中创建文本文件

无法在PHP(nginx)中创建文本文件,php,nginx,Php,Nginx,我的网站目录的根目录中有: $filename = "test01.txt"; //the name of our file. $content = "This is our test file"; //what we will be writing to our file. $strlength = strlen($content); //gets the length of our $content string. $create = fopen($filename, "w"); //use

我的网站目录的根目录中有:

$filename = "test01.txt"; //the name of our file.
$content = "This is our test file"; //what we will be writing to our file.
$strlength = strlen($content); //gets the length of our $content string.
$create = fopen($filename, "w"); //uses fopen to create our file.
$write = fwrite($create, $content, $strlength); //writes our string to our file.
$close = fclose($create); //closes our file
echo("File Created, Click <a href='$filename'> Here </a> to view it.");
我只想用php脚本创建一个文本文件,但它不起作用。 你知道吗?
谢谢

确保目录是可写的组www,并且您也可以使用函数文件\u put\u内容


文件\u放置\u内容$create,$content

你有什么错误?你确定该文件夹是可写的吗?你能实际看到该文件夹中的文件吗?可能href链接不起作用…当我刷新FTP时,我什么也看不到。我得到0个错误。我不明白是什么问题