I currently have a couple of servers, running CentOS: Lighttpd/MySQL/Php5.1.x - because that's the PHP version that installs with Yum. The problem is that 5.1.x is out of date (by a long time) and in order to use the software I want (WP3.2), I need 5.2.x.

I've been a'searching and I can't seem to find anything that has any ideas - there was a post for Debian suggesting compiling PHP automatically (do-able, just need to make sure it works) - now my understanding of PHP and Lighttpd is thus:

Lighttpd has a fastcgi module, which is programmed to send all PHP processing requests to a file/ "gateway" defined in /conf.d/fastcgi.conf. What I'm not sure of is whether this is generally any PHP processor - for instance the new version 5.3, or whether I need fastcgi for it.

Any help would be massively appreciated, thanks guys!

  • 3
    Sorry.. what's the question? Jul 4 '11 at 17:59
  • My bad - I'm wondering how to get PHP 5.3 working together with Lighttpd on CentOS.
    – George
    Jul 4 '11 at 18:24

You'll need PHP compiled with FastCGI support, and have at least a few PHP-FastCGI processes running. See this page for more info: http://www.fastcgi.com/drupal/node/5?q=node/10

As is often the case with CentOS, you will probably need to compile this yourself. There is some RPM packages out there which can be found by googling, but those generally require you to add a complete new repository maintained by some unknown stranger (with lots of beta-status packages) or download the package as well as all dependencies manually (I usually prefer the manual way for production servers).

If you have a choice, consider switching to Debian - I've found it much easier to host stuff on Debian which is stable, have lots of packages with not-too-old version numbers in the main repositories, and lots of good documentation.

  • Thanks! I'll and spin up a server and have a play with Debian now - my original choice was CentOS because it has such a small footprint, which on low powered servers makes a massive difference. Any idea to what extent this is true of Debian?
    – George
    Jul 4 '11 at 18:26
  • Debian is cheap on resources. The standard installation (without any server software installed, but with tools like ping and dig) is about 800 MB on disk if I recall correctly. I've never managed to get any CentOS installation under 1.5 GB. My home server, which act as gateway, web server, file server, database, e-mail and some other stuff uses 300 MB of RAM (disk cache not included), and I have 2 GB RAM installed so I've had no reason to try to minimize that usage. Jul 4 '11 at 19:35

Consider adding a yum repository - EPEL and or Remi Collet's repository. Both have fairly recent copies of PHP (Remi's repository is typically updated with each new version of PHP).

It might save you the effort of compiling PHP, and supports a very modular structure (you can add specific PHP extensions in the same way (both repositories above separate the main PHP-core from the additional extensions).

Additionally, both of the above have RPMs to install the repository. Just remember to disable the repositories and enable them only when needed (to prevent overwriting things that shouldn't be overwritten!) - also consider the yum priorities plugin.

You can probably use php-fpm (it has recently been introduced into the php-core (since 5.3.3) - and is FastCGI process manager - it works well with both apache and nginx - and I believe it should work with lighttpd as well).


I've gone in search of the Remi repo and found this: http://blog.famillecollet.com/post/2010/09/28/PHP-FPM-and-LIGHTTPD which looks awesome, like it's exactly what I want. However, I keep pulling up massive errors when I try and use the repo - epel/primary_db | 3.7 MB 00:00
hxxp://remi-mirror.dedipower.com/fedora/5/remi/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. hxxp://rpms.famillecollet.com/fedora/5/remi/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. hxxp://remirpm.mirror.gymkl.ch/fedora/5/remi/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: remi. Please verify its path and try again

Any suggestions? (Thanks!)

  • Off hand it looks like you are trying to add a Fedora repository (and an outdated one at that - v5) to a CentOS distribution. The path above should be hxxp://rpms.famillecollet.com/enterprise/5/x86_64... Ensure you get the right RPM: hxxp://rpms.famillecollet.com/enterprise/remi-release-5.rpm and check your yum config files (/etc/yum.repos.d/)
    – cyberx86
    Jul 4 '11 at 23:26
  • I had a play with this and it continued to refuse to play - I got php5-fpm installed and lighttpd refused to play ball, I'm actually wondering whether configuring PHP caching with Apache would just make life a whole lot easier for me (I'm running several med to high traffic WP sites) Jul 5 '11 at 21:17
  • I might suggest trying Nginx before you abandon the non-Apache approach - the overhead on Apache is significant and Nginx with W3-Total-Cache makes for a low load high performance Wordpress site. Actually, I might even suggest trying Squid or Varnish before going back to Apache - the cached approach - especially if generating static files - would work best outside of Apache (but, of course, will work in Apache too) - can you access php-fpm from Apache (i.e. is it a php-fpm config issue or a Lighttpd issue?)
    – cyberx86
    Jul 5 '11 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy