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 - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -