Can't open file from PHP -


i have following code:

    <?php         $myfile = fopen("code2.css", "w") or die("unable open file!");         $txt = "john doe\n";         fwrite($myfile, $txt);         $txt = "jane doe\n";         fwrite($myfile, $txt);         fclose($myfile);     ?> ?> 

code2.css in same folder php file, throws me:

unable open file time.

how can fix this?

update: after playing permissions error dissapeared, still file won't updated.

check properties of code2.css. must found "read only" permission it, , change "read , write". after code work.

if using linux system, execute:

sudo chmod 777 code2.css 

Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

Save and close a word document by giving a name in R -