HOWTO: Install PHP7.0 or PHP 7.2 on CentOS 7
Re: HOWTO: Install PHP7 on CentOS 7
Technically, yes, you should but it's unlikely to to remove in 7.baijianpeng wrote:Today I tried your above steps again, when I run the following command, I got error: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.
Did I missed something?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.
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?
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
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/
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/
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
Re: HOWTO: Install PHP7 on CentOS 7
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
Next, I went to the backend "system information" of Joomla and saw following message:
Why?PHP Version 5.6.27
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
Did you restart PHP-FPM and NGINX/Apache?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:
Then I created a new website on VestaCP panel and installed Joomla CMS for that website.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
Next, I went to the backend "system information" of Joomla and saw following message:
Why?PHP Version 5.6.27
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.
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
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
Re: HOWTO: Install PHP7 on CentOS 7
I had followed EVERY step in your tutorial, including this command but got not success information: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
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.
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
You should not be typing
The below cost replaces php70-php-fpm
Reload systemctl daemon
Then Vesta can restart PHP-FPM. You need to use service php-fpm start
Code: Select all
service php70-php-fpm start
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
Code: Select all
systemctl daemon-reload
Re: HOWTO: Install PHP7 on CentOS 7
And tell me output of this
Code: Select all
systemctl status php70-php-fpm.service
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
Re: HOWTO: Install PHP7 on CentOS 7
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.
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
Re: HOWTO: Install PHP7 on CentOS 7
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:
The first 4 lines (commands) was executed successfully. But, the 5th, got error:
Then I tried to find the file "php-fpm.service" but got:
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.
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
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.
Code: Select all
# locate php-fpm.service
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
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
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?
Did you install Vesta with NGINX + php-fpm?