Page 10 of 11

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Sun Apr 22, 2018 1:28 pm
by kaavain
Hi

Does it works if I've installed Vesta as Apache + NGINX?

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Mon May 21, 2018 1:37 pm
by Xanesi
Thank you, I finally did it-)
__________________________
All the best: DashBoard Software Open Source

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Sun Jun 17, 2018 8:59 pm
by johnmc
I'm trying to understand what the point of this update procedure is/what it's doing different. I've been experimenting with updating by doing the following and it's worked so far with both Nginx+PHP-FPM and Nginx+Apache.

Remi repo needs to be setup first.

Code: Select all

yum install -y yum-utils
yum-config-manager --disable remi-php55
yum-config-manager --disable remi-php56
yum-config-manager --enable remi-php72
yum -y update
edit: During the update I get some warnings when it's done on a Nginx+PHP-FPM system. Looking over the warnings it seems like they are about individual components that link to other components of an incorrect version. However later in the update those previously warned about components are updated... so I think it's ok.

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Wed Jun 20, 2018 8:18 pm
by quasi
@ SS88 Thank you for this extensive tutorial.
SS88 wrote:
Fri Mar 16, 2018 2:06 pm
This will install PHP 7.2. It will replace old PHP versions.

...
Now open up new PHP-FPM.conf ( /etc/opt/remi/php72/php-fpm.conf ) file and change line 11 to:

Code: Select all

include=/etc/php-fpm.d/*.conf
>>> This didn't work for me. Folder /etc/php-fpm.d/ doesn't exist but the original does. So I kept the original.

SS88 wrote:
Sat Mar 17, 2018 5:25 pm
Ok,

If you've not done anything else other than use the install commands, you can just remove this file:

/etc/httpd/conf.modules.d/10-php.conf

And restart apache. Make a backup first!
Thx, this totally solved my problem.

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Wed Jun 27, 2018 10:48 pm
by vguns
Thank you! I updated to php7.2
But I can not install Memcached according to this instruction https://www.mysterydata.com/how-to-inst ... cp-centos/
help me please...

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Sat Jul 07, 2018 1:32 pm
by compiz
Is there a guide on how to update the php7.0 to php7.2 in ubuntu 16.04?
For Nginx + php-fpm

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Thu Aug 16, 2018 1:16 am
by kaz050457
What's the reason why vestacp team not updgrading the php vesion so no need like this to manual install it.. Most CMS now required minimun php 7.0.. ???

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Thu Aug 16, 2018 10:27 am
by ScIT
kaz050457 wrote:
Thu Aug 16, 2018 1:16 am
What's the reason why vestacp team not updgrading the php vesion so no need like this to manual install it.. Most CMS now required minimun php 7.0.. ???
the reason is your repository, vesta does install the default php version served by your os. If you install for example ubuntu 16.04 you will get php 7.0 automatically.

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Sat Dec 01, 2018 11:10 am
by baoang
kaz050457 wrote:
Thu Aug 16, 2018 1:16 am
What's the reason why vestacp team not updgrading the php vesion so no need like this to manual install it.. Most CMS now required minimun php 7.0.. ???
try remi when executing the installation script.

Re: HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7

Posted: Thu Jan 03, 2019 2:35 pm
by ozmarketingtrend
How to install PHP 7.2 on CentOS 7 as an operating system.

PHP is a server-side scripting language commonly used for Web development, but it is also used as a general-purpose programming language. PHP powers WordPress, the most popular content management system used for blogging and building websites as well as may other e-commerce websites, customer relationship management software, enterprise resource planning software and much more. Installing PHP 7.2 on CentOS 7 is a pretty easy task and it should be completed in less than 10 minutes.

PHP 7 offers much better performances than PHP 5.6 and older PHP versions. Compared with PHP 5.6, PHP 7.2 could execute as much as three times more requests. If you have installed WordPress on your Linux VPS, this means much lower server load, thus you should expect your website to run faster with PHP 7.2.

In addition, PHP 7.2 offers some security improvements. There are some deprecations though that you may want to check before you consider upgrading to PHP 7.2.

1. Prerequisites
install php 7.2 on CentOS 7Before you install PHP 7.2 on your CentOS VPS, let’s make sure it is fully up to date. To update all your system software to the latest version you need to have root access to the server or at least you have sudo privileges with your system user. Connect to your Linux VPS via SSH and run the following command:

yum update
The software update will take few seconds or minutes depending on what packages need to be updated. Once it is completed you can proceed with enabling the required repositories. PHP 7.2 is not provided in the default CentOS 7 repositories, so you need to enable the following:

Enable EPEL:

yum install https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm
Install yum-utils if it is not already installed.

yum install yum-utils
Enable the Remo repository for PHP 7.2:

yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php72
Once you are done with these steps, you can go ahead and install PHP 7.2

2. Install PHP 7.2 on CentOS 7
To install PHP 7.2 on your CentOS 7 VPS, run the following command:

yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json
This will install PHP 7.2 as well as other commonly used PHP extensions. To verify PHP 7.2 is successfully installed, run the following command:

php72 -v
The output should be similar to the one below:

# php72 -v
PHP 7.2.10 (cli) (built: Sep 11 2018 10:09:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies
Create a symbolic link to /usr/bin/php

ln -s /usr/bin/php72 /usr/bin/php
Verify again

php -v
The output should be similar to this:

# php -v
PHP 7.2.10 (cli) (built: Sep 11 2018 10:09:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies
Once you have PHP 7.2 installed on your CentOS 7 VPS you may want to customize some of the settings. Follow the steps below to do so.

3. Customize the PHP 7.2 settings on CentOS 7
You can customize PHP 7.2 by editing the php.ini file. To find the path to this file, you can use the command below:

php --ini | grep "Loaded Configuration File"
The command will return the path to the php.ini file which is currently used.

# php --ini | grep "Loaded Configuration File"
Loaded Configuration File: /etc/opt/remi/php72/php.ini
You can use any editor of your choice to edit the file. We will use nano in our example.

nano /etc/opt/remi/php72/php.ini
4. Verify if the PHP files are being executed on the serve
Once you change the settings you want to change, save and close the php.ini file. If you are using Apache as a web server, you need to restart the Apache service for the new configuration to be loaded and for the changes to take effect. If you are using Nginx and PHP-FPM instead of Apache, you should restart the PHP-FPM service.

To check if the PHP files are being executed on the server you can create a sample info.php file and access it via web browser.

nano /var/www/html/info.php
Paste the following content:

<?php phpinfo(); ?>
Save and close the file, then open your favorite web browser and access the file by using your server IP address in the URL followed by the name of the file.

http://IP-ADDRESS/info.php

Hope this helps!
Thanks,
Amit Deka |Digital Marketing Agency India