: Make a custom Apache handler (for multiple PHP versions) I've successfully installed PHP 5.2 and it runs as CGI. (5.3 is my default running on mod, or as the phpinfo says "Server API: Apache
I've successfully installed PHP 5.2 and it runs as CGI.
(5.3 is my default running on mod, or as the phpinfo says "Server API: Apache 2.0 Handler")
Ultimately I want to put something like AddHandler application/x-httpd-php52 in the .htaccess file of the directory I want to run it in. is that defined somewhere? (since in compiled php 5.2 myself)
However, this only really works in virtual hosts because I can't wrap my head around how to define a custom handler.
<FilesMatch ".php">
SetHandler application/x-httpd-php5
</FilesMatch>
ScriptAlias /php52-cgi /usr/lib/cgi-bin/php52-cgi
Action application/x-httpd-php5 /php52-cgi
AddHandler application/x-httpd-php5 .php
How can I do something like AddHandler application/x-httpd-php52 in the .htaccess?
More posts by @Vandalay111
2 Comments
Sorted by latest first Latest Oldest Best
I've figured it out.
in /etc/apache/apache2.conf (or httpd.conf)
ScriptAlias /php52-cgi /usr/lib/cgi-bin/php52-cgi
Action application/x-httpd-php52 /php52-cgi
in .htaccess (or virtualhost)
<FilesMatch ".php">
SetHandler application/x-httpd-php52
</FilesMatch> #AddHandler application/x-httpd-php52 .php .php5 .php4 .php3
(don't seem to need the AddHandler, just the FilesMatch, can anyone explain why?)
I mostly followed the instructions here
Create or edit an .htaccess file and add the following:
AddHandler application/x-httpd-php52 .php .php5 .php4 .php3
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.