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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -