VestaCP upgrade instructions for apache to php-fpm CentOS

In my previous post could you read about the performance of PHP-fpm vs Apache. In this post, I will tell you how you can upgrade to PHP-fpm on an existing server with Apache. To make it easier, I wrote a script for centos 6.7.

  1. First install PHP-FPM with the Vesta config files.
  2. Edit the Vesta config file.
  3. Edit vesta domain config files (templates).
  4. Remove existing config files (/home/username/conf/web/)
  5. Rebuild users
  6. Remove apache

Tip: First take backups of your configuration files!

After the upgrade, I noticed that PHP version has been decreased from 5.4 to 5.3. phpMyAdmin and RoundCube also stopped working. I have PHP upgraded to 5.6 and reinstalled phpMyAdmin and RoundCube.

The script can be downloaded here: [sdm_download id=”125″ fancy=”0″]

Or run as root:

wget “https://birdseyeview.be/?smd_process_download=1&download_id=125” -O script.sh

bash script.sh

After the upgrade, you need to log out to you admin panel. Also, all the templates are replaced with the default.

Upgrade php:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

yum install yum-plugin-replace

yum replace php-common –replace-with=php56w-common

and reinstall phpmyadmin and roundcube

wget “https://birdseyeview.be/?smd_process_download=1&download_id=164” -O upgarde.sh

bash upgarde.sh

Attention! This does not always work correctly. There may be a lot of bugs. Run at your risk. First take backups !!

In my previous post could you read about the performance of PHP-fpm vs Apache. In this post, I will tell you how you can upgrade to PHP-fpm on an existing server with Apache. To make it easier, I wrote a script for centos 6.7.

  1. First install PHP-FPM with the Vesta config files.
  2. Edit the Vesta config file.
  3. Edit vesta domain config files (templates).
  4. Remove existing config files (/home/username/conf/web/)
  5. Rebuild users
  6. Remove apache

Tip: First take backups of your configuration files!

After the upgrade, I noticed that PHP version has been decreased from 5.4 to 5.3. phpMyAdmin and RoundCube also stopped working. I have PHP upgraded to 5.6 and reinstalled phpMyAdmin and RoundCube.

 

The script can be downloaded here: [sdm_download id=”125″ fancy=”0″]

Or run as root:

wget “https://birdseyeview.be/?smd_process_download=1&download_id=125” -O script.sh

bash script.sh

After the upgrade, you need to log out to you admin panel. Also, all the templates are replaced with the default.

 

Upgrade php:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

yum install yum-plugin-replace

yum replace php-common –replace-with=php56w-common

and reinstall phpmyadmin and roundcube

wget “https://birdseyeview.be/?smd_process_download=1&download_id=164” -O upgarde.sh

bash upgarde.sh

 

Attention! This does not always work correctly. There may be a lot of bugs. Run at your risk. First take backups !!


9 Replies to “VestaCP upgrade instructions for apache to php-fpm CentOS”

  1. Hi,
    Thanks for this great blog, very clear!
    Is there a reason you don’t choose PHP 7 (yet) + Opcache?

    • Hi Johan,
      Good point! I have no idea why I have done that. Maybe when I started on this post PHP7 wasn’t released yet. The post was meant to show how you can change Apache with PHP-fpm on a vestaCP server, I don’t think it’s that hard to install php7. And I haven’t tested my websites how they work on php7.

  2. dear Tjebbe Lievens,
    thanks for great tutorial to upgrade from apache+nginx to nginx+php-fpm.. i try on my vps work perfect
    but after upgrade.. webmail and phpmyadmin can’t open anymore (timeout)
    can u give me some suggestion to repair this problem ?

    Thanks

    • I noticed this bug also. I didn’t find a fix for it. I guess it’s some wrong config file. Every time I go to the webmail or PHPMyAdmin port 8080 is added to the URL. Removing this number and it works back.

  3. Hi,
    Sorry but when changing “vesta.conf” it say premission denied!
    /usr/local/vesta/conf/vesta.conf

    I can’t change chmod or anythings.
    how we can bypass this error?

Leave a Reply

Your email address will not be published. Required fields are marked *