In this “how to” we will see how to setup cherokee on Ubuntu with PHP5-FPM (FastCGI Process Manager). Although the cherokee CookBook claims that “If PHP-fpm binaries are found, those will be prioritized over the regular binaries.” it turns out that the latest stable version of cherokee in Launchpad gives errors while enabling it. So here is the work around.
- Add the cherokee PPA and install cherokee
apt-get install cherokee
- Add PHP5-FPM PPA, install it and start it
apt-get install php5-fpm
service php5-fpm start
- Start cherokee admin
and open http://<your-ip-address>:9090/ in your browser and use the “One-time Password”
- Inside the control panel click on “Sources” and click on “+” (Add new information Source) and fill in the connection field with 127.0.0.1:9000 (PHP5-FPM Service port)
- Next, go to “vServers” and click on “Behaviour” tab for the default vServer. Click on “Rule Management”
Go to the “+”(Add Behavior Rule) and click on Manual
- Go to the “Handler” tab and select “FastCGI” as the Handler
Scroll down to the “FastCGI Specific” section and select the “Balancer” as “Round Robin”
Select the “Application Server” as php
- Save and gracefully restart to see the changes.
Test it with phpinfo();
If everything goes OK, you should have a fully functional PHP setup ready on Cherokee.