Page 2 of 10

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Wed Oct 12, 2016 11:51 am
by SS88
baijianpeng wrote:
SS88 wrote: I don't know if you have done this but I updated the commands and removed "yum -y remove php" and now everything works as expected.
Today I tried your above steps again, when I run the following command, I got error:

Code: Select all

# service php-fpm stop
Redirecting to /bin/systemctl stop  php-fpm.service
Failed to stop php-fpm.service: Unit php-fpm.service not loaded.
Did I missed something?

Thank you.

PS: I think, "service ..." is a command on CentOS 6.x, right? On CentOS 7, you should use "systemctl ... ", right? Why you still use "service ... " command on CentOS7?
Technically, yes, you should but it's unlikely to to remove in 7.

When you issue "service" it states: Redirecting to /bin/systemctl - so it works correctly.

If it fails, you can skip that step because it's removed, relinked to php 7 and added back to systemctl

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Wed Oct 12, 2016 12:05 pm
by bonkrs
Get the repositories:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/e ... noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/web ... elease.rpm

Then:

yum install yum-plugin-replace
yum replace php-common --replace-with=php70w-common

More details at https://webtatic.com/packages/php70/

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 11:03 am
by baijianpeng
SS88 wrote: Technically, yes, you should but it's unlikely to to remove in 7.

When you issue "service" it states: Redirecting to /bin/systemctl - so it works correctly.

If it fails, you can skip that step because it's removed, relinked to php 7 and added back to systemctl

Today I followed your steps on a fresh installed clean CentOS 7 Minimal (1511) and VestaCP 0.98-16 . This step returned the same error as former. Then I ignored that as you instructed. Then I run rest steps and finally I "see" php7 when execute this command:

Code: Select all

# php -v
PHP 7.0.12 (cli) (built: Oct 13 2016 16:56:51) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies
Then I created a new website on VestaCP panel and installed Joomla CMS for that website.

Next, I went to the backend "system information" of Joomla and saw following message:
PHP Version 5.6.27
Why?

I think my old PHP 5.x should be replaced with new PHP7, but why Joomla still running on PHP 5?

I even tried reboot my server and then check it again in Joomla, it still shows "php 5.6.27".

Well, @SS88, did you really tested your tutorial on CentOS7 ? Since you insist to use "service ..." command instead of "systemctl ..." command, I guess maybe you just copied your steps on CentOS 6 here?

I am looking for a "repeatable" solid solution about "upgrading to/installing PHP 7 on CentOS 7 for VestaCP". If you have some spare time, could you please check again your steps on CentOS 7 minimal installation with Joomla CMS ?

Before you confirm this can really change the PHP version for Joomla, I am afraid I can not execute your tutorial on my production server.

Thank you.

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 12:01 pm
by SS88
baijianpeng wrote:
SS88 wrote: Technically, yes, you should but it's unlikely to to remove in 7.

When you issue "service" it states: Redirecting to /bin/systemctl - so it works correctly.

If it fails, you can skip that step because it's removed, relinked to php 7 and added back to systemctl

Today I followed your steps on a fresh installed clean CentOS 7 Minimal (1511) and VestaCP 0.98-16 . This step returned the same error as former. Then I ignored that as you instructed. Then I run rest steps and finally I "see" php7 when execute this command:

Code: Select all

# php -v
PHP 7.0.12 (cli) (built: Oct 13 2016 16:56:51) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.12, Copyright (c) 1999-2016, by Zend Technologies
Then I created a new website on VestaCP panel and installed Joomla CMS for that website.

Next, I went to the backend "system information" of Joomla and saw following message:
PHP Version 5.6.27
Why?

I think my old PHP 5.x should be replaced with new PHP7, but why Joomla still running on PHP 5?

I even tried reboot my server and then check it again in Joomla, it still shows "php 5.6.27".

Well, @SS88, did you really tested your tutorial on CentOS7 ? Since you insist to use "service ..." command instead of "systemctl ..." command, I guess maybe you just copied your steps on CentOS 6 here?

I am looking for a "repeatable" solid solution about "upgrading to/installing PHP 7 on CentOS 7 for VestaCP". If you have some spare time, could you please check again your steps on CentOS 7 minimal installation with Joomla CMS ?

Before you confirm this can really change the PHP version for Joomla, I am afraid I can not execute your tutorial on my production server.

Thank you.
Did you restart PHP-FPM and NGINX/Apache?

When you issue command php -v that means the server is using the correct php binary, but your web server might not. To fix that, just restart PHP-FPM and it should now use PHP7

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 3:09 pm
by baijianpeng
SS88 wrote: Did you restart PHP-FPM and NGINX/Apache?

When you issue command php -v that means the server is using the correct php binary, but your web server might not. To fix that, just restart PHP-FPM and it should now use PHP7
I had followed EVERY step in your tutorial, including this command but got not success information:

Code: Select all

# service php70-php-fpm start
Redirecting to /bin/systemctl start  php70-php-fpm.service
Job for php70-php-fpm.service failed because the control process exited with error code. See "systemctl status php70-php-fpm.service" and "journalctl -xe" for details.
Why?

I also had REBOOT my server, I think everything will be restarted when I restart the whole server, right?

Why Joomla still running on PHP 5?

Like I mentioned before, when I perform those two steps involving "fpm" things, I always got no success result. Did you get the same result? Why the same command get DIFFERENT results on the SAME CentOS7 environment?

This is why I hope you repeat those steps on a clean CentOS7 v1511 minimal installation, after VestaCP installed, then perform your methods to upgrade the PHP. If you can not re-produce the same result, this tutorial need to be improved.

Thank you.

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 3:17 pm
by SS88
You should not be typing

Code: Select all

service php70-php-fpm start
The below cost replaces php70-php-fpm

Code: Select all

rm -f /usr/lib/systemd/system/php-fpm.service
ln -s /usr/lib/systemd/system/php70-php-fpm.service /usr/lib/systemd/system/php-fpm.service
Reload systemctl daemon

Code: Select all

systemctl daemon-reload
Then Vesta can restart PHP-FPM. You need to use service php-fpm start

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 3:17 pm
by SS88
And tell me output of this

Code: Select all

systemctl status php70-php-fpm.service

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 3:27 pm
by baijianpeng
The output is:

Code: Select all

# systemctl status php70-php-fpm.service
‚óŹ php70-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php70-php-fpm.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2016-10-16 23:26:09 CST; 26s ago
  Process: 3593 ExecStart=/opt/remi/php70/root/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
 Main PID: 3593 (code=exited, status=78)

Oct 16 23:26:09 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Oct 16 23:26:09 localhost.localdomain php-fpm[3593]: [16-Oct-2016 23:26:09] ERROR: Unable to globalize '/et...11.
Oct 16 23:26:09 localhost.localdomain php-fpm[3593]: [16-Oct-2016 23:26:09] ERROR: failed to load configura...nf'
Oct 16 23:26:09 localhost.localdomain php-fpm[3593]: [16-Oct-2016 23:26:09] ERROR: FPM initialization failed
Oct 16 23:26:09 localhost.localdomain systemd[1]: php70-php-fpm.service: main process exited, code=exited,.../n/a
Oct 16 23:26:09 localhost.localdomain systemd[1]: Failed to start The PHP FastCGI Process Manager.
Oct 16 23:26:09 localhost.localdomain systemd[1]: Unit php70-php-fpm.service entered failed state.
Oct 16 23:26:09 localhost.localdomain systemd[1]: php70-php-fpm.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 4:17 pm
by baijianpeng
I started again from beginning, from a clean CentOS 7 v1511 installation, after I install VestaCP 0.98-16, I performed following commands following your tutorial:

Code: Select all

# 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
# service php-fpm stop
The first 4 lines (commands) was executed successfully. But, the 5th, got error:

Code: Select all

# service php-fpm stop
Redirecting to /bin/systemctl stop  php-fpm.service
Failed to stop php-fpm.service: Unit php-fpm.service not loaded.
Then I tried to find the file "php-fpm.service" but got:

Code: Select all

# locate php-fpm.service
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
Why this file exists in your CentOS7 but not in mine?
If it is also missing in your CentOS, why you keep this command in your tutorial?
If I skip/ignore this line of command, will the result be affected?

This is very confusing. Hope you will do a fresh testing to reproduce your results.

Thank you.

Re: HOWTO: Install PHP7 on CentOS 7

Posted: Sun Oct 16, 2016 5:39 pm
by SS88
There should be no issue stopping php-fpm like that. As you installed Vesta. Vesta uses this command.

Did you install Vesta with NGINX + php-fpm?