How can I tell Apache2, run mod_php5 by default but run this VH in CGI mode?

前端 未结 2 1080
孤城傲影
孤城傲影 2021-01-19 15:33

The Server

I have a development server that I\'m using to host my current projects. Here are some stats:

root@myserver:/usr/bin $ ca         


        
2条回答
  •  暖寄归人
    2021-01-19 16:10

    A good alternative is suPHP.

    If set up properly, you can have as many handlers, as you wish; even for different directories within a virtual host.

    For added security, there's suPHP's "paranoid" mode in which you assign a Unix user and group to a virtual host and the scripts will be run as that user.

    My suPHP config looks like that:

    ...
    
    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php4-cgi
    x-httpd-php5=php:/usr/bin/php5-cgi
    
    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self
    
    ...
    

    Within a simple .htaccess file it is possible to have scripts run using different versions of PHP:

    
       SetHandler x-httpd-php
    
    
    
       SetHandler x-httpd-php5
    
    
    # etc...
    

    Hope that helps.

提交回复
热议问题