File writes fail from scripts w/out php ext

software development

#1

I’m not sure if I’m doing something wrong in my script or if this is the normal behaviour of PHP or Dreamhost.

I use the addHandler directive in a .htaccess file to make .foo files behave like .php files, which works fine, except when I try to write files with file_put_contents() nothing happens. The function doesn’t even generate an error message but simply returns false.

So, who’s to blame?

PS: How do you add a signature to your messages?

Edit: I forgot to mention the Suhosin Patch is installed. It could be the reason, too.


#2

i think you’d need to post a sample of your code. i don’t think just obfuscating the extension would affect some built-in PHP functions and not others.


#3

Sorry, I solved it myself. I didn’t give the right handler-name in the .htaccess file. I was using “application/x-httpd-php5” but should have been using “php5-cgi” as described in the Wiki.