I'm trying to replicate a web-site on a test-server. However, on the test-server, .php
files don't get interpreted. I found that the cause is a .htaccess
file in the document root. Its contents:
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
RewriteEngine On
#RewriteRule ^$ index.php [QSA]
RewriteRule ^(.*)$ /web/$1
How do I configure Apache2/PHP5 to support the handler application/x-httpd-php5s
? Is there any software-package which makes this handler available?
Update: It may be a handler specific to Bluehost.com. Am currently investigating this...
Update 2: To avoid having to change the .htaccess
file, which would introduce inconsistencies, I added a handler "application/x-httpd-php5s" to Apache:
AddHandler application/x-httpd-php5s .php
Action application/x-httpd-php5s /cgi-bin/php5
However, that handler will not behave as on the production server, where it causes the PHP interpreter to use a php.ini
in the document root and use it for all subdirectories. A somewhat ugly workaround is, for example, to symlink that php.ini
to the global php.ini
on the test-server.
I have been using Bluehost for a long time. What you are talking about is only the php.ini file that gets loaded.
AddHandler application/x-httpd-php5s .php
Loads a single php.ini file for all sites hosted on there server. That php.ini file is usually found in the public_html folder.
If you change it to;
AddHandler application/x-httpd-php5 .php
Then the server will look for php.ini in the same folder as your .htaccess file.
The "s" at the after the 5 means single.
AddHandler application/x-httpd-php5s is the source handler.
All you have to do is change it to AddHandler application/x-httpd-php5 .php
I have since convinced my client to move away from Bluehost, for performance reasons. So it's a non-issue for us now. However, from what I've seen, I am pretty certain that x-httpd-php5s
this is a Bluehost specific handler.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.