Blog

PHP7 and Vesta – easy setup

Learn how to set up PHP7 on your server with Vesta Control Panel for improved performance and functionality.

anton
centos php PHP installation Vesta CP CentOS 7 server management web hosting

PHP7 and Vesta – Easy Setup

PHP7, released on December 3, 2015, is a significantly revised version of one of the most popular web languages. While many websites still use the old, well-established PHP5.x, we strongly recommend transitioning to the latest PHP versions for substantial performance improvements.

For detailed benchmarks, check out this PHP 5.6 vs HHVM 3.7 vs PHP 7 Benchmarks.

In this guide, we’ll set up your dedicated server or SSD VDS using the popular and free Vesta Control Panel. Order a server or SSD VDS with CentOS 7 OS; the setup typically takes about 10-15 minutes. Then log in to the server using SSH to begin.

Step 1: Install Vesta Control Panel

  1. Download the installation script:
    curl -O http://vestacp.com/pub/vst-install.sh
    bash vst-install.sh
    
  2. Wait for the installation to finish, usually taking 5-10 minutes. Note the generated admin password for later use.

Vesta CP comes with PHP 5.4.x by default, so we will upgrade it to PHP7.

Step 2: Add the REMI Repository

To update to PHP7, add the REMI repository:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
yum --enablerepo=remi update remi-release

Step 3: Upgrade to PHP7

  1. Stop Apache and PHP-FPM services:
    service httpd stop
    service php-fpm stop
    
  2. Remove the old PHP version:
    yum -y remove php
    
  3. Install PHP7 and necessary modules:
    yum -y --enablerepo=remi-php70 install php70-php php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring
    
  4. Create a symlink for PHP:
    rm -f /usr/bin/php
    ln -s /usr/bin/php70 /usr/bin/php
    
  5. Restart Apache and PHP-FPM services:
    service httpd restart
    service php70-php-fpm start
    

Confirmation

Check your PHP version with:

php -v

If everything is set up correctly, you should see an output confirming PHP7 is installed.

Final Steps

Now, log in to your Vesta Control Panel, create a new virtual host, and upload your CMS files as needed.

Looking for a VDS or Dedicated Server for Vesta?

Order any SSD VDS or dedicated server, and use coupon code VESTA-WEB-PANEL for a lifetime 10% discount! Our skilled support team is always available to assist you.

Need Help?

Our support team is available 24/7 to assist you with any questions or issues.

Contact Support