Hi Guys,

In the past and on current sites, i've been able to run php scripts on .html files after adding the following line of code to .htaccess

AddType application/x-httpd-php .html .htm

On a particular server one of my sites is on, after trying to add this line to .htaccess, my site returned a 500 internal server error 🙁

I talked to tech support, and they told me to put it in a file called php.ini and delete the htaccess file (because they use some thing called phpsuexec or something like that).

I tried this as well. The 500 internal error is gone, however the html page isn't reading the php.

Anyone know a fix ?

Thanx - Jamez

    The reason it didn't work in ".htaccess" is that with "suexec" PHP runs as a CGI. With that directive, Apache looks for a module and doesn't find it.

    In your "php.ini" did you supply the CGI path to PHP, something like "Action application/x-httpd-php /cgi-bin/php" (in addition to the "AddType" line; tells Apache where to look)? That might work. Also, with "suexec", you need to put "php.ini" in every directory that needs its directives.

      Sounded promising but doesn't appear to be working.

      I'm only trying to get the index.html page to read php right now, so php.ini is only in the /www folder.

      I dont see a "path to php" listed anywhere, so i just pasted your line in and nothing changed as far as the page reading the php.

      My server is using Linux in cunjunction with Apache Version 1.3.31 (Unix). The path to perl is /usr/bin/perl , php version is 4.3.8

      i don't know what other info you would need but if anyone knows how the fix should go please share.. my stupid #%@% hosting company replied to my support ticket with "try renaming all your file names with .php" :glare:

      They are borderline ready to get FIRED and take my money elsewhere... does anyone know of a good hosting company that provides unlimited reseller accounts, with all the standard features (cpanel, fully compatible with PHP so i dont have these issues, etc).

        Write a Reply...