I can get it to work as filename.php but not as filename.html.
$fh = fopen("output_php.html", 'w') or die("can't open file");
fwrite($fh, "Writing from PHP file works!");
creates file output_php.html with one line of content, no output to screen.
$fh = fopen("output_html.html", 'w') or die("can't open file");
fwrite($fh, "Writing from HTML file works!");
Warning: fopen(output_html.html) [function.fopen]: failed to open stream: Permission denied in /home/.ceefer/adminsean/hcal.ca/writetest.html on line 2
can't open file
The code in both files is identical. The only difference is the extension of the file containing the code. HTML is definitely being parsed by the php processor because the error is thrown BY the php parser. Addditionally, any other php code in the file does work. It just refuses to open files.
I tried this on my local apache install and both files work fine. There is something on my dreamhost setup that is restricting the html file from performing php file operations.
I am losing my mind here... I do not want to change all of my files to php extensions because people have already been linking to and visiting the site as-is!
I am going to open a support ticket now, but if anyone has any more insight please please let me know.
Thanks a bunch!
ps: here is my .htaccess:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
php_flag magic_quotes_runtime off
php_flag magic_quotes_gpc off
php_flag magic_quotes_sybase off
php_flag register_globals off