impossible to create text file in PHP (nginx) -
impossible to create text file in PHP (nginx) -
i have in root of website directory:
$filename = "test01.txt"; //the name of our file. $content = "this our test file"; //what writing our file. $strlength = strlen($content); //gets length of our $content string. $create = fopen($filename, "w"); //uses fopen create our file. $write = fwrite($create, $content, $strlength); //writes our string our file. $close = fclose($create); //closes our file echo("file created, click <a href='$filename'> here </a> view it.");
i want create text file php script, doesn't work. have thought ? give thanks you
make sure dir writable (group www), , can utilize function file_put_contents
file_put_contents($create, $content);
php nginx
Comments
Post a Comment