Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would it be possible to run certain scripts (this could be in either a vhost or directory setting in the apache conf) to run as mod_php when the current server configuration is running FPM/FastCGI?

Server OS: Ubuntu-Server 11.04

share|improve this question
up vote 0 down vote accepted

Well, the easy answer would be just to install mod_php and php_fcgi - and do not define the x-application PHP handler in any of your configs. Then it would use mod_php.

share|improve this answer

To run PHP both with mod_php and fastcgi, you can also use PHP-FPM and Apache mod_actions

Install mod_fcgi and mod_actions for Apache. Install and configure PHP-FPM.

And add to the virtual host config following block

<IfModule mod_fastcgi.c>
<IfModule mod_actions.c>
    FastCGIExternalServer /var/www/<document_root_path>/php.fastcgi -socket /var/run/php-fpm.sock

    Action php-fcgi-script /php.fastcgi virtual

    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
        SetHandler php-fcgi-script

I prefer to run PHP-FPM listening a UNIX socket.

But you can also configure your PHP-FPM to run on local port, so you should change -socket config parameter to the -host ip:port

FastCGIExternalServer configuration

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.