Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to install PHP FPM on my CentOS 5.6 server, but I wasn't able to get it to work. After downloading PHP 5.3.20 from their php.net, configuring it, making it and installing it, I got this message:

Installing PHP SAPI module:       fpm
Installing PHP CLI binary:        /usr/bin/
Installing PHP CLI man page:      /usr/share/man/man1/
Installing PHP FPM binary:        /usr/sbin/
Installing PHP FPM config:        /etc/
Installing PHP FPM man page:      /usr/share/man/man8/
Installing PHP FPM status page:      /usr/share/fpm/
Installing build environment:     /usr/lib/build/
Installing header files:          /usr/include/php/
Installing helper programs:       /usr/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/share/man/man1/
  page: phpize.1
  page: php-config.1

At that point, I assumed PHP was installed so I restarted Apache, but it was serving PHP files as plain text. How do I fix this? How do I get PHP FPM enabled on my CentOS 5.6 box?

Thanks!

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

You're looking for apache to act as a reverse proxy, using php-fpm as the backend application server.

  1. Ensure that php-fpm configured and running: service php-fpm restart and check logs for failure

  2. Ensure that somewhere in your apache config, you have loaded the correct proxying modules:

  3. Also, you need to include a proxypass directive so apache knows where to send the request for fulfillment.

Part of your apache config might look something like this, assuming php-fpm is running on port 9000:

LoadModule  proxy_module         modules/mod_proxy.so
LoadModule  proxy_fcgi_module    modules/mod_proxy_fcgi.so
<VirtualHost *:80>
  ServerName    localhost
  DocumentRoot  "/var/www/html"
  ProxyPass     ProxyPass /myapp/ fcgi://localhost:9000
</VirtualHost>

If this is not sufficient, update your question with more information about your apache config and you php-fpm config and exactly what commands you're running and the results you get.

share|improve this answer
    
Thanks I will give this a try. –  cyphun Jan 16 '13 at 15:44
add comment

According to what you posted, php was successfully installed. But you need to tell Apache you are going to use it. I've never really used apache + php fpm, but this link might help you http://www.webtatic.com/packages/php53/

it explains how to install php + php-fpm from prebuild repositiories. Next step would be to enable php work on cgi mode in apache http://www.bobulous.org.uk/coding/apache-php-cgi.html

I hope I've been helpful

share|improve this answer
    
Welcome to Server Fault. I see you are new so please take this as genuine advice. Consider only posting "tangible" answers to questions on Server Fault. What I mean by tangible is that the content of your answer should resolve the question. Posting links/URLs as answers does not help make Server Fault the destination, but only a gateway. Also, some day, that link will go offline and your answer loses all relevancy. (Linkrot) –  Aaron Copley Jan 16 '13 at 14:44
add comment

Your Answer

 
discard

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.