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
Post a Comment