Page 1 of 1
Nginx only. How to upgrade to PHP7 FPM?
Posted: Fri Jun 17, 2016 3:42 am
by delebash
System Info
Fresh install of Ubuntu 14.04 from Digital Ocean droplet
Fresh install of Vesta with Nginx only option
I can upgrade to php 7.0 in command line without any problems. However nginx is not recognizing php7.0. I have followed this upgrade guide for php7.0 and nginx
https://www.howtoforge.com/tutorial/ins ... -lts-lemp/
Replacing /etc/nginx/sites-available/default with vesta's nginx.conf user/conf/web/nginx.conf
I pruged php5 and removed apache2, but phpinfo() still shows php5.
Not sure what else to change?
Thanks.
Re: Nginx only. How to upgrade to PHP7 FPM?
Posted: Wed Jun 22, 2016 1:06 pm
by SS88
Did you restart PHP-FPM?
Re: Nginx only. How to upgrade to PHP7 FPM?
Posted: Fri Jun 24, 2016 2:57 am
by delebash
Yes I did also rebooted.
I figured out what was wrong. I was trying setup PHP-FPM to use a TCP connection method instead of the Socket method. If you look in your nginx.conf file that vesta creates it is setup to use TCP see line
I modified /etc/php/7.0/fpm/pool.d/
www.conf according to the first post to the below accounting for vesta's fastcgi_pass port of 9001 instead of 9000
TCP connection method
Code: Select all
nano /etc/php/7.0/fpm/pool.d/www.conf
Code: Select all
;listen = /var/run/php7.0-fpm.sock
listen = 127.0.0.1:9001
This did not work, however if I do not use the TCP connection method and use the Socket method by changing nginx.conf to
Comment out
Then add
Code: Select all
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
and edit
Code: Select all
nano /etc/php/7.0/fpm/pool.d/www.conf
again reversing the previous changes back to the socket method by uncommenting the socket line and commenting the tcp line
Code: Select all
listen = /var/run/php7.0-fpm.sock
;listen = 127.0.0.1:9001
Everything works as expected.
I am ok with using the Socket method but since vesta has it setup by default to use the TCP method I would like to know what changes need to be made to keep using the TCP method when upgrading to PHP7.
Thanks,
Dan
Re: Nginx only. How to upgrade to PHP7 FPM?
Posted: Thu Oct 22, 2020 4:24 pm
by ad73738
Hello,
I'm running my VESTA CP in ubuntu. I have two php versions installed, one of them used in command line and another in webpages.
Code: Select all
:/etc/php$ ll
total 24
drwxr-xr-x 4 root root 4096 Oct 19 17:37 ./
drwxr-xr-x 127 root root 12288 Oct 20 11:45 ../
drwxr-xr-x 6 root root 4096 Jan 17 2017 7.0/
drwxr-xr-x 7 root root 4096 Oct 9 2019 7.2/
Code: Select all
$ php -v
PHP 7.2.19-0ubuntu0.18.04.2 (cli) (built: Aug 12 2019 19:34:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.19-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies
phpinfo says that webpages are using php 7.0.
How can I setup it so webpages uses php 7.2?