can't for the life of me work out why this isn't working - on a dreamhost server, I've created an htaccess file and added AddHandler php5-cgi .html .htm
to allow php in html files, as per the dreamhost docs. On an identical dreamhost package, I've done the same thing for another site and it worked perfectly, but in this case it just won't parse the php! Is there anything I could have missed here which could be causing the problem? The htaccess is in the web root and isn't being overridden by anything else.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
try this
The above setting will work if the apache is picking php as a module.
or
above will work if apache is executing php as CGI?
there is no harm i would say to put both of the above conditions together but try one over other and see if it work for you.
read more here
I've got the same problem as you but I just put this
AddType php .html .htm
to my .htaccess, it's working.Is your server using suPHP rather than mod_php or plain php-cgi?
Try using
or
instead.
Postscript
Shared Hosting services use UID based separation on individual accounts from each others. Most use suPHP, but some use suEXEC. They will use one of these. Both act as a su wrapper around php-cgi so you can't tell from the phpinfo()as its PHP scripting engine as this will report
Server API
CGI/FastCGI
in both cases. For CGI initiated scripts, phpinfo doesn't report on the Apache config. You need either to look at your hosting provider's FAQ or possibly try:The hosting provider's support forums / FAQ might give specific configuration advice here. Have you tried them?
For me it is working for only like this: