[remi-php56]name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch#baseurl=http://rpms.famillecollet.com/enterprise/6/php56/$basearch/mirrorlist=http://rpms.famillecollet.com/enterprise/6/php56/mirror# WARNING: If you enable this repository, you must also enable "remi"enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

d) Now install the latest and greatest version of PHP (5.6.1 as of today)

Install Virtualmin, but since PHP is already installed on the system I decide to update the "install.sh" so that only one version of PHP is on the system. I also took this change to remove stuff I don't use like Postgres.

a) Get Virtualmin

wget http://software.virtualmin.com/gpl/scripts/install.sh

b) Edit the install.sh file

vi install.sh

c) Install Virtualmin and login for the first time to complete the post installation wizard

Configure NGINX to use TCP connections instead of Unix sockets. I know that Unix sockets might bring an extra performance benefit, but until there is a Webmin module to manage NGINX and PHP-FPM I try to keep it as simple as possible. I will explain how to use sockets at the end.

a) Go to Webmin > Server > Ngnix Webserver > Module Config

Change Connect Nginx to PHP processes with from Socket files to TCP connections

Step 6:

Let's now disable the default way Virtualmin execute PHP (php-cgi) so that when you create a new site it uses PHP-FPM instead of PHP-CGI. I haven't been able to use PHP-FPM to run under the user account of the site, but since I only have one site hosted it is not a problem for me. You might have to weight your needs against the benefits of this setup.

; RPM: apache Choosed to be able to access some dir as httpduser = apache; RPM: Keep a group allowed to write in log dir.group = apache

Change it with:

; RPM: apache Choosed to be able to access some dir as httpduser = nginx; RPM: Keep a group allowed to write in log dir.group = nginx

Step 8:

Now at this point PHP-FPM is not running, but your are ready to create your site. This is the only cabeat you have to consider when creating a new site. Since you told NGINX to use a TCP Connection the default connection will look for 127.0.0.1:9000 and that is the port PHP-FPM uses, but if PHP-FPM is running and using the port 9000 when the new site is created it will listed in 127.0.0.1:9001. You can manually adjusted later on, but to keep it simple I stop PHP-PFM when creating a new site.

a) Go ahead and create your new site

b) After this start PHP-PFM like this:

service php-fpm start

c) If you visit your site you will see a 403 error and that is because there is nothing in public_html.

d)Visit /home/SITE-ACCOUNT/public_html and add an index.php file

vi index.php

add and save:

<?php

phpinfo();

?>

e) Revisit the site and now you should see PHP information page with the latest PHP version and running from PHP-PFM. You are done.

================================================================

Miscellaneous

So, you want to run PHP-FPM from an Unix Socket instead of a TCP connection? No problem.

a) Go to Webmin > Server > Ngnix Webserver > Module Config

Change Connect Nginx to PHP processes with from TCP connections to Socket files

Very nice tutorial. But before doing this I would like to ask you about benchmarks. Why? Because just disabling Apache and installing Nginx, everything will work as expected. No need to use PHP-FPM. I did some scenarios in my machine, PHP-CGI is providing same results as PHP-FPM, sometimes a litter better in miliseconds. For example PHP-FPM 120ms, PHP-CGI 98 ms.

A huge improvement appears when you replace this stuff with HHVM. HHVM is capable to decrease this time to half.

As a conclusion, there is no need to use PHP5-FPM when initial PHP-CGI is available and providing same results. If anyone came to this conclusion please share some thoughts.

I can see your point and I first I was ok, just by switching from Apache to Nginx and keeping PHP-CGI.

But I use Drupal 7 on my projects and it is not a secret that any Drupal page can have a thousand queries and a lot of include PHP code that have to render into the HTML page the user see. I don't have numbers to show you, but I have tested the above setup in few production servers and in a 2 GB VPS with CentOS 6.5 I have been able to handle a lot of traffic without affecting the performance of the site.

One thing I have noticed is that if you restart the PHP-FPM service the first visit to your site will be a bit slower due to the cache been recreated. In another project I added Memcache and in combination with the OpCode I can see a lot of improvement as well. At the end of the day each site is different and the clients needs are different, but in my experience the faster the site the happier the client.

I am using Magento 1.9 which is very hungry with resources. In my tests there is no improvement replacing PHP-CGI 5.5 with PHP-FPM. I read some articles about how PHP-CGI is functioning comparing it with PHP-FPM, but they were related to versions before 5.3. With PHP-FPM I need to be very careful to its configurable parameters like pm_xxxxx. From a point of view, after a while I will completely switch to HHVM or PHP-NG just for more performance related to PHP. If you use HHVM you won't need OpCache.

But I have installed a phpMyAdmin in one subdomain and a Roundcube in another subdomain. But in phpMyAdmin the page turn a blank page after the login. Why?

And in roundcube, I can login, but I cant send, neither receive emails no action. When I click to refresh mail list, the progress bar stay in progress forever. Is not a problem with POP or SMTP server, in Outlook I'm receiving and sending normally.

Hello guys!
I'm wanting to understand a point of your tutorial, I found it quite explanatory, I'm trying to understand why you made two tutorials, one day Sun, 05/10/2014 and another full day Sun, 08/10/2014, what difference to him ? I'm not understanding these differences, I used Apache for a long time, I already used nginx for a few months for testing in my vps tests I used a ISPCo control panel ... which was the same as working in the command line all I had to do the terminal, spent hours copying and pasting things from my note, several configuration lines for anything that needed doing, dkim keys and configure the e-mail, all an interminable and hard work. everything was very manual, to add a new domain and install a simple wordpress website was a great labor, took a long time, I've been worried with the load that would bring me in the future and returned to virtualmin with apache, but I am now having problem of too much use of memory ram and regretted not having stay with nginx, now I'm with him on a new vps with virtualmin + nginx + php-cgi standard of virtualmin, I'm trying to disable the php-cgi to nginx use php-fpm ...

but I'm having a great concern with respect because so afraid of people use php-fpm _ nginx in virtualmin ??!

because so many people in forums are asking quite a module for virtualmin make this integration of php-fpm with nginx?

because switch socket for TCP socket it has better performance?

use Socket will make that task in manual tasks in the administration of my server?

I just use wordpress websites. and a simple single website in php / mysql too. this tutorial here by chance have to be done with each new domain added to my vps, will not be all the automatic create feature server virtualmin as when using apache?

this is not to be done only once the virtualmin will manage all the rest as it did with apache...
add new domains (create server, auto ssl keys signed for each website, dkim key for all emails, etc ...)?? ..

this tutorial I use the first day of the 10/08 or 10/05 addition, I would like to understand the difference between the two because my English is bad and I would like an explanation in which case these two tutorials above fit?
Thanks all.