Page 10 of 11

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

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

Posted: Sat Mar 09, 2019 6:59 pm
by menriquez
Amit...thank you for your awesome work helping people upgrade to PHP72 on CENTOS.

I have read all 11 pages of posts here, I have PHP72 installed correctly. I am currently using apache as my web server and nginx as proxy and I have a few questions...

1. running CLI `php -i` i get php 7.2 no problem...however, running phpinfo() on the server webpage I am still getting php5.6 running and YES I have restarted apache several times. ALSO, the opcache isn't loading with PHP72 according to php -i ...ugh i know :((

2. you ask in the above post to run this...

Code: Select all

php -ini | grep "Loaded Configuration File"
Failed loading /usr/lib64/php/modules/dbg-php-5.6.so:  /usr/lib64/php/modules/dbg-php-5.6.so: undefined symbol: zval_used_for_init
Loaded Configuration File => /etc/php.ini
3. My TTFB (time to first byte) for my database-heavy real estate website is terrible (6 to 10seconds!!)...do you think a different server setup (ie using nginx as webserver maybe?) could give the website better performance? I am hoping that running PHP72 with apache would help a good deal, but i can't seem to get that working (see above)

Thanks for any help you can give me!

- mark
PS... here are some dumps...first from CLI php -ini

Code: Select all

PHP Version => 7.2.16

System => Linux webwarephpdevelopment 2.6.32-042stab128.2 #1 SMP Thu Mar 22 10:58:36 MSK 201
8 x86_64
Build Date => Mar  5 2019 14:44:49
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Scan this dir for additional .ini files => /etc/php.d
Additional .ini files parsed => /etc/php.d/20-bcmath.ini,
/etc/php.d/20-bz2.ini,
/etc/php.d/20-calendar.ini,
/etc/php.d/20-ctype.ini,
/etc/php.d/20-curl.ini,
/etc/php.d/20-dom.ini,
/etc/php.d/20-exif.ini,
/etc/php.d/20-fileinfo.ini,
/etc/php.d/20-ftp.ini,
/etc/php.d/20-gd.ini,
/etc/php.d/20-gettext.ini,
/etc/php.d/20-gmp.ini,
/etc/php.d/20-iconv.ini,
/etc/php.d/20-imap.ini,
/etc/php.d/20-intl.ini,
/etc/php.d/20-json.ini,
/etc/php.d/20-ldap.ini,
/etc/php.d/20-mbstring.ini,
/etc/php.d/20-mysqlnd.ini,
/etc/php.d/20-pdo.ini,
/etc/php.d/20-phar.ini,
/etc/php.d/20-posix.ini,
/etc/php.d/20-pspell.ini,
/etc/php.d/20-recode.ini,
/etc/php.d/20-shmop.ini,
/etc/php.d/20-simplexml.ini,
/etc/php.d/20-soap.ini,
/etc/php.d/20-sockets.ini,
/etc/php.d/20-sqlite3.ini,
/etc/php.d/20-sysvmsg.ini,
/etc/php.d/20-sysvsem.ini,
/etc/php.d/20-sysvshm.ini,
/etc/php.d/20-tidy.ini,
/etc/php.d/20-tokenizer.ini,
/etc/php.d/20-xml.ini,
/etc/php.d/20-xmlwriter.ini,
/etc/php.d/20-xsl.ini,
/etc/php.d/30-mcrypt.ini,
/etc/php.d/30-mysqli.ini,
/etc/php.d/30-pdo_mysql.ini,
/etc/php.d/30-pdo_sqlite.ini,
/etc/php.d/30-wddx.ini,
/etc/php.d/30-xmlreader.ini,
/etc/php.d/30-xmlrpc.ini,
/etc/php.d/40-zip.ini

PHP API => 20170718
PHP Extension => 20170718
Zend Extension => 320170718
Zend Extension Build => API320170718,NTS
PHP Extension Build => API20170718,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => enabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => available, disabled

Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, comp
ress.bzip2, phar, zip
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.
1, tlsv1.2
Registered Stream Filters => zlib.*, string.rot13, string.toupper, string.tolower, string.st
rip_tags, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*, mcrypt.*, mdecrypt.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
now from <?php phpinfo() ?> on webpage...

Code: Select all

PHP Version 5.6.40
System	Linux webwarephpdevelopment 2.6.32-042stab128.2 #1 SMP Thu Mar 22 10:58:36 MSK 2018 x86_64
Build Date	Jan 9 2019 12:34:28
Server API	Apache 2.0 Handler
Virtual Directory Support	disabled
Configuration File (php.ini) Path	/etc
Loaded Configuration File	/etc/php.ini
Scan this dir for additional .ini files	/etc/php.d
Additional .ini files parsed	/etc/php.d/20-bcmath.ini, /etc/php.d/20-bz2.ini, /etc/php.d/20-calendar.ini, /etc/php.d/20-ctype.ini, /etc/php.d/20-curl.ini, /etc/php.d/20-dom.ini, /etc/php.d/20-exif.ini, /etc/php.d/20-fileinfo.ini, /etc/php.d/20-ftp.ini, /etc/php.d/20-gd.ini, /etc/php.d/20-gettext.ini, /etc/php.d/20-gmp.ini, /etc/php.d/20-iconv.ini, /etc/php.d/20-imap.ini, /etc/php.d/20-intl.ini, /etc/php.d/20-ldap.ini, /etc/php.d/20-mbstring.ini, /etc/php.d/20-mcrypt.ini, /etc/php.d/20-mysqlnd.ini, /etc/php.d/20-pdo.ini, /etc/php.d/20-phar.ini, /etc/php.d/20-posix.ini, /etc/php.d/20-pspell.ini, /etc/php.d/20-recode.ini, /etc/php.d/20-shmop.ini, /etc/php.d/20-simplexml.ini, /etc/php.d/20-soap.ini, /etc/php.d/20-sockets.ini, /etc/php.d/20-sqlite3.ini, /etc/php.d/20-sysvmsg.ini, /etc/php.d/20-sysvsem.ini, /etc/php.d/20-sysvshm.ini, /etc/php.d/20-tidy.ini, /etc/php.d/20-tokenizer.ini, /etc/php.d/20-xml.ini, /etc/php.d/20-xmlwriter.ini, /etc/php.d/20-xsl.ini, /etc/php.d/30-mysql.ini, /etc/php.d/30-mysqli.ini, /etc/php.d/30-pdo_mysql.ini, /etc/php.d/30-pdo_sqlite.ini, /etc/php.d/30-wddx.ini, /etc/php.d/30-xmlreader.ini, /etc/php.d/30-xmlrpc.ini, /etc/php.d/40-json.ini, /etc/php.d/40-twig.ini, /etc/php.d/40-zip.ini
PHP API	20131106
PHP Extension	20131226
Zend Extension	220131226
Zend Extension Build	API220131226,NTS
PHP Extension Build	API20131226,NTS
Debug Build	no
Thread Safety	disabled
Zend Signal Handling	disabled
Zend Memory Manager	enabled
Zend Multibyte Support	provided by mbstring
IPv6 Support	enabled
DTrace Support	available, disabled
Registered PHP Streams	https, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar, zip
Registered Stream Socket Transports	tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters	zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*, mcrypt.*, mdecrypt.*
Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

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

Posted: Sat Mar 30, 2019 7:00 am
by MET4LG0D
recently I have install vestacp Nginx + PHP-FPM on Centos 7, Now I Want 2 Update PHP-FPM 73
anyone can tell me the process.......
Thanks...........