suphp 方式下 多版本php共存的配置

参考部分文档地址
http://www.kvm.la/apache-php52-with-php53.html

经检验发现 此文中基本正确除了  .htaccess 需要这样写

<FilesMatch “\.(inc|php|php3|php4|php5|php6|phtml|phps)$”>
AddHandler x-httpd-php52 .inc .php .php3 .php4 .php5 .php6 .phtml
</FilesMatch>

!!!首先你得会编译一份fastcgi模式的php哦!!!

 

其余需要配置的文件和参考地址相同,现在列出如下

/usr/local/suphp/etc/suphp.conf

[handlers]
;Handler for php-scripts
x-httpd-php5=”php:/usr/local/php5/bin/php-cgi”
x-httpd-php52=”php:/usr/local/webserver/php/bin/php-cgi”

 /etc/httpd/conf/extra/httpd-suphp.conf

<IfModule mod_suphp.c>
<FilesMatch “\.(inc|php|php3|php4|php5|php6|phtml|phps)$”>
AddHandler x-httpd-php5 .inc .php .php3 .php4 .php5 .php6 .phtml
</FilesMatch>
<Location />
suPHP_Engine on
suPHP_ConfigPath /usr/local/etc/php5/cgi/
suPHP_AddHandler x-httpd-php5
suPHP_AddHandler x-httpd-php52

</Location>
</IfModule>