Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

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

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
103 posts
  • Page 6 of 11
    • Jump to page:
  • Previous
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • 8
  • …
  • 11
  • Next
usr999
Posts: 78
Joined: Sat Jul 25, 2015 3:37 pm

Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by usr999 » Wed Nov 22, 2017 5:46 am

How to install roundcube and phpmyadmin on php7+php-fpm?
Top

Pim
Posts: 33
Joined: Fri Sep 30, 2016 12:44 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by Pim » Thu Nov 23, 2017 11:23 am

Hi. Thank you for your guide.

I have that problem after install:

Code: Select all

Error: php70w-common conflicts with php-common-5.6.32-1.el7.remi.x86_64
Top

shishupal
Posts: 9
Joined: Fri Jan 19, 2018 9:51 am

Os: CentOS 6x
Web: apache + nginx
Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by shishupal » Wed Jan 24, 2018 10:33 am

Is there any notification to get PHP 7 default on next update??
Top

M4nDrK
Posts: 1
Joined: Mon Feb 12, 2018 7:36 pm

Os: CentOS 6x
Web: apache + nginx
Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by M4nDrK » Mon Feb 12, 2018 7:39 pm

i follow and works fine thanks. but. now i need same instructions for nginx + apache plz.
Top

baijianpeng
Posts: 301
Joined: Tue Dec 22, 2015 2:06 pm

Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by baijianpeng » Wed Mar 14, 2018 5:44 am

I read another article which provided a new way to update default PHP 5.6.x to PHP7 on CentOS 7, it also introduced some skills to optimize VestaCP as well :

https://vpsguide.net/tutorials/vps-tuto ... -centos-7/


Hope someone will compare these two methods and tell us which is better?

Thank you.
Top

LorenzoVonMatterhorn
Posts: 7
Joined: Sat Mar 10, 2018 1:32 pm

Os: CentOS 5x
Web: apache + nginx
Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by LorenzoVonMatterhorn » Thu Mar 15, 2018 2:58 am

KuJoe wrote: ↑
Sun Aug 06, 2017 12:55 pm
For those interested in getting RoundCube working with PHP 7 in CentOS 7 here you go:

Remove all traces of PHP 5.x (including RoundCube):

Code: Select all

yum remove php
Now install PHP 7.0 using the code in the first post (also follow all of the steps in the first post, this is just here for completeness sake):

Code: Select all

yum -y --enablerepo=remi install php70 php70-php php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring
Now download the latest version of the RoundCube RPM (as of this post):

Code: Select all

wget ftp://195.220.108.108/linux/remi/enterprise/7/test/x86_64/roundcubemail-1.3.0-2.el7.remi.noarch.rpm
Now install RoundCube:

Code: Select all

rpm -i --nodeps roundcubemail-1.3.0-2.el7.remi.noarch.rpm
Run these commands (the version in the URLs will most likely change so make sure it matches the current version of VestaCP):

Code: Select all

wget c.vestacp.com/0.9.8/rhel/httpd-webmail.conf -O /etc/httpd/conf.d/roundcubemail.conf
wget c.vestacp.com/0.9.8/rhel/roundcube-main.conf -O /etc/roundcubemail/main.inc.php
wget c.vestacp.com/0.9.8/rhel/roundcube-db.conf -O /etc/roundcubemail/db.inc.php
wget c.vestacp.com/0.9.8/rhel/roundcube-driver.php -O  /usr/share/roundcubemail/plugins/password/drivers/vesta.php
wget c.vestacp.com/0.9.8/rhel/roundcube-pw.conf -O /usr/share/roundcubemail/plugins/password/config.inc.php
chmod a+r /etc/roundcubemail/*
Now just restart Apache and nginx (not sure if both are needed but it can't hurt):

Code: Select all

service httpd restart;service nginx restart
And RoundCube is working again. Enjoy! :D
After two weeks I found your answer and that was the only correct answer for default vestacp installation. With my thanks.
Top

baoang
Posts: 40
Joined: Fri Feb 23, 2018 7:31 am

Os: CentOS 5x
Web: nginx + php-fpm
Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by baoang » Fri Mar 16, 2018 1:48 pm

juslintek wrote: ↑
Wed Sep 20, 2017 11:32 pm
abst wrote:How update php 7 to 7.1/7.2 after using this manual for uprate from 5.6 to php 7?
Do the same as with php70, you can yum search php72 and it will list all the packages. Then install ones required. Finally do all the same as wtih php70, just replace php70 keyword with php72. I've got it working. But vesta still has php-fpm greyed out.

Update:

Noticed that php7*w packages work better then without w.
Vesta still has php-fpm greyed out? So that means, I guess, there are now two versions of php, the old one of php70, and the freshly installed one of php72, and the greyed php is under Vesta's control, and the newly installed php70 is not?
shishupal wrote: ↑
Wed Jan 24, 2018 10:33 am
Is there any notification to get PHP 7 default on next update??
My current installation, nginx+php-fpm style, produces php v5.33, a bit lower than v5.6. I also hope there soon will be an update to push the old ver to the current one, so that I can install phpBB v3.2 easily.

It's not that easy to unload the shipped php-fpm v5.33 and replace it with a more freshed one, ver 7.x, although v5.6 is the minimum of phpBB v3.2 installation.
Top

SS88
Posts: 336
Joined: Thu Nov 19, 2015 12:40 pm

Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by SS88 » Fri Mar 16, 2018 2:06 pm

This will install PHP 7.2. It will replace old PHP versions.

If you have REMI Repository you can skip this step.

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
Then enable Remi

Code: Select all

yum --enablerepo=remi update remi-release
Now remove old PHP and install PHP7

Code: Select all

service php-fpm stop
yum -y --enablerepo=remi install php72-php php72-php-pear php72-php-bcmath php72-php-pecl-jsond-devel php72-php-mysqlnd php72-php-gd php72-php-common php72-php-fpm php72-php-intl php72-php-cli php72-php php72-php-xml php72-php-opcache php72-php-pecl-apcu php72-php-pecl-jsond php72-php-pdo php72-php-gmp php72-php-process php72-php-pecl-imagick php72-php-devel php72-php-mbstring
Remove and re-link new PHP 7.2

Code: Select all

rm -f /usr/bin/php
ln -s /usr/bin/php72 /usr/bin/php
Test if we have PHP 7.2

Code: Select all

php -v
Output should be (take note of PHP 7.2!!)

Code: Select all

[root@tiny system]# php -v
PHP 7.2.3 (cli) (built: Mar  2 2018 12:24:56) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.3, Copyright (c) 1999-2018, by Zend Technologies
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
Start PHP-FPM

Code: Select all

service php72-php-fpm start
Remove old systemctl php-fpm and link to new one

Code: Select all

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

Code: Select all

systemctl daemon-reload
Top

baoang
Posts: 40
Joined: Fri Feb 23, 2018 7:31 am

Os: CentOS 5x
Web: nginx + php-fpm
Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by baoang » Fri Mar 16, 2018 3:16 pm

SS88 wrote: ↑
Fri Mar 16, 2018 2:06 pm
This will install PHP 7.2. It will replace old PHP versions.
......
Remove old systemctl php-fpm and link to new one

Code: Select all

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

Code: Select all

systemctl daemon-reload
Thanks! SS88, very detailed description on the operation.

Mine is on CentOS v6.9, and misses systemctl:(

That's why I try to figure out if I could take a shortcut to get a remi
viewtopic.php?f=10&t=16403

Actually, my installation is nginx+php-fpm, mysql, ... no mail, no DNS, no remi, almost a bare one.
Top

pepsi
Posts: 20
Joined: Wed Apr 26, 2017 1:51 am

Re: HOWTO: Install PHP7 on CentOS 7
  • Quote

Post by pepsi » Sat Mar 17, 2018 4:07 am

SS88 wrote: ↑
Fri Mar 16, 2018 2:06 pm
This will install PHP 7.2. It will replace old PHP versions.
...snip...
Hello. Thanks for the guide but I'm having some issues. I did all the steps and basically the problem is when I run 'php -v', I get PHP 7.2.X, but my actual websites are still running PHP 5.6 (I'm checking via phpinfo).

To go further, I followed the guide without issue up until where you say to "Start PHP-FPM". But this is what I get when I attempt that:

Code: Select all

[root@server01]# service php72-php-fpm start
Redirecting to /bin/systemctl start 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]#
[root@server01]#
[root@server01]# 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 Sat 2018-03-17 04:02:13 UTC; 8s ago
  Process: 9138 ExecStart=/opt/remi/php72/root/usr/sbin/php-fpm --nodaemonize (code=exited, status=78)
 Main PID: 9138 (code=exited, status=78)

Mar 17 04:02:13 server01 systemd[1]: Starting The PHP FastCGI Process Manager...
Mar 17 04:02:13 server01 php-fpm[9138]: [17-Mar-2018 04:02:13] ERROR: Unable to globalize '/etc/php-fpm.d/*.conf' (ret=2) from /etc/opt/remi/php72/php-fpm.conf at line 11.
Mar 17 04:02:13 server01 php-fpm[9138]: [17-Mar-2018 04:02:13] ERROR: failed to load configuration file '/etc/opt/remi/php72/php-fpm.conf'
Mar 17 04:02:13 server01 php-fpm[9138]: [17-Mar-2018 04:02:13] ERROR: FPM initialization failed
Mar 17 04:02:13 server01 systemd[1]: php72-php-fpm.service: main process exited, code=exited, status=78/n/a
Mar 17 04:02:13 server01 systemd[1]: Failed to start The PHP FastCGI Process Manager.
Mar 17 04:02:13 server01 systemd[1]: Unit php72-php-fpm.service entered failed state.
Mar 17 04:02:13 server01 systemd[1]: php72-php-fpm.service failed.
Do you have any idea what is going wrong? I did this on a fresh VestaCP install on CentOS 7. Can you verify what settings I should have chosen when running vst-install.sh? Like for WEB what should I have picked (nginx + apache, nginx + php-fpm)? I want to be running Apache as the main web server.
Top


Post Reply
  • Print view

103 posts
  • Page 6 of 11
    • Jump to page:
  • Previous
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • 8
  • …
  • 11
  • Next

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password