Page 8 of 11

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

Posted: Sat Mar 17, 2018 5:33 pm
by SS88
And then if you want to make updates in future to PHP 7.2 you'll need to do this:

Code: Select all

yum install yum-utils
yum-config-manager --disable remi-php56
yum-config-manager --disable remi-php55
yum-config-manager --disable remi-php56-debuginfo
yum-config-manager --disable remi-php55-debuginfo
yum clean all
yum update

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sat Mar 17, 2018 5:42 pm
by pepsi
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!
When you say other than use the install commands, if you're referring to the commands you provided to upgrade to PHP7 then that's all I've done. I installed VestaCP using vst-install script, and then used the commands you gave in your post.

That said, I did what you mentioned in the series of posts above but still getting the same error message:

Code: Select all

[root@server01 ~]# mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php.conf.bak
[root@server01 ~]#
[root@server01 ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
[root@server01 ~]#
[root@server01 ~]# mv /usr/bin/php-cgi /usr/bin/php-cgi.bak
[root@server01 ~]# ln -s /usr/bin/php72-cgi /usr/bin/php-cgi
[root@server01 ~]#
[root@server01 ~]# systemctl restart php72-php-fpm.service
Job for php72-php-fpm.service failed because the control process exited with error code. See "systemctl status php72-php-fpm.service" and "journalctl -xe" for details.
[root@server01 ~]#
Running "systemctl status php72-php-fpm.service" outputs the same errors as initially posted. Any ideas? Sorry to keep bugging ya.

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sat Mar 17, 2018 5:45 pm
by SS88
This command: mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php.conf.bak

Place move it out of that directory. In Apache it includes using a wildcard so .bak is still an included file.
pepsi wrote:
Sat Mar 17, 2018 5:42 pm
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!
When you say other than use the install commands, if you're referring to the commands you provided to upgrade to PHP7 then that's all I've done. I installed VestaCP using vst-install script, and then used the commands you gave in your post.

That said, I did what you mentioned in the series of posts above but still getting the same error message:

Code: Select all

[root@server01 ~]# mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php.conf.bak
[root@server01 ~]#
[root@server01 ~]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service
[root@server01 ~]#
[root@server01 ~]# mv /usr/bin/php-cgi /usr/bin/php-cgi.bak
[root@server01 ~]# ln -s /usr/bin/php72-cgi /usr/bin/php-cgi
[root@server01 ~]#
[root@server01 ~]# systemctl restart php72-php-fpm.service
Job for php72-php-fpm.service failed because the control process exited with error code. See "systemctl status php72-php-fpm.service" and "journalctl -xe" for details.
[root@server01 ~]#
Running "systemctl status php72-php-fpm.service" outputs the same errors as initially posted. Any ideas? Sorry to keep bugging ya.

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

Posted: Sat Mar 17, 2018 5:55 pm
by SS88
Sorry I forgot to tell you to uninstall the php-fpm

Yum remove php72-php-fpm

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

Posted: Sat Mar 17, 2018 6:02 pm
by pepsi
SS88 wrote:
Sat Mar 17, 2018 5:55 pm
Sorry I forgot to tell you to uninstall the php-fpm

Yum remove php72-php-fpm
I completely removed the file "/etc/httpd/conf.modules.d/10-php.conf.bak" so it shouldn't get caught in any wildcard calls.

Then I did "yum remove php72-php-fpm" and getting this:

Code: Select all

[root@server01 ~]# systemctl restart php72-php-fpm.service
Failed to restart php72-php-fpm.service: Unit not found.
Which makes sense since I just removed it. Am I supposed to be restarting another phpXX-php-fpm service?

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

Posted: Sat Mar 17, 2018 7:50 pm
by SS88
No need to restart, just restart Apache as it’s part of the whole thing. As long as you linked php-cgi together too you’ll be fine!

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

Posted: Sun Mar 18, 2018 5:46 pm
by pepsi
SS88 wrote:
Sat Mar 17, 2018 7:50 pm
No need to restart, just restart Apache as it’s part of the whole thing. As long as you linked php-cgi together too you’ll be fine!
Sorry just getting back to ya, but looks like you're right! Both php -v and phpinfo() is showing 7.2. Thanks a ton for the help!

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

Posted: Sun Apr 08, 2018 7:02 am
by sandy
easy guide to upgrade
https://www.mysterydata.com/upgrade-php ... -vesta-cp/

process are same for upgrading from php 5.6, 7.0 and 7.1 to 7.2

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

Posted: Fri Apr 20, 2018 5:31 am
by hknerdr
SS88 wrote:
Sat Mar 17, 2018 5:55 pm
Sorry I forgot to tell you to uninstall the php-fpm

Yum remove php72-php-fpm
Hello,

Thanks for the instructions. I have done everything, but my phpinfo() is still showing 5.6.35 version.

Also when i put php - v i get this:
PHP Warning: Zend OPcache huge_code_pages: madvise(HUGEPAGE) failed: Invalid argument (22) in Unknown on line 0
PHP 7.2.5RC1 (cli) (built: Apr 11 2018 08:39:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5RC1, Copyright (c) 1999-2018, by Zend Technologies
Image

I also get this:
systemctl status php72-php-fpm.service
● php72-php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php72-php-fpm.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Cum 2018-04-20 08:57:47 +03; 4s ago
Process: 787 ExecStart=/opt/remi/php72/root/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
Main PID: 787 (code=exited, status=78)

Nis 20 08:57:47 bebece.net systemd[1]: Starting The PHP FastCGI Process Manager...
Nis 20 08:57:47 bebece.net php-fpm[787]: [20-Apr-2018 08:57:47] NOTICE: PHP message: PHP Warning: Zend OPcache huge_code_pages: madvise(HUGEPAGE) failed: Invalid argument (22) in Unknown on line 0
Nis 20 08:57:47 bebece.net php-fpm[787]: [20-Apr-2018 08:57:47] ERROR: Unable to globalize '/etc/php-fpm.d/*.conf' (ret=2) from /etc/opt/remi/php72/php-fpm.conf at line 11.
Nis 20 08:57:47 bebece.net php-fpm[787]: [20-Apr-2018 08:57:47] ERROR: failed to load configuration file '/etc/opt/remi/php72/php-fpm.conf'
Nis 20 08:57:47 bebece.net php-fpm[787]: [20-Apr-2018 08:57:47] ERROR: FPM initialization failed
Nis 20 08:57:47 bebece.net systemd[1]: php72-php-fpm.service: main process exited, code=exited, status=78/n/a
Nis 20 08:57:47 bebece.net systemd[1]: Failed to start The PHP FastCGI Process Manager.
Nis 20 08:57:47 bebece.net systemd[1]: Unit php72-php-fpm.service entered failed state.
Nis 20 08:57:47 bebece.net systemd[1]: php72-php-fpm.service failed.
Also i change php.ini file over ssh but it is not showing on phpinfo()

edit: I deleted old php versions and reinstalled as your instructions but now i get 500 internal server error :(

waiting for your help.

Thanks

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

Posted: Fri Apr 20, 2018 10:40 am
by SS88
Hi,

Can you tell me:
  • Your Operating System
  • Your web stack i.e. nginx/apache or nginx only