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

Nginx only. How to upgrade to PHP7 FPM?

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
delebash
Posts: 22
Joined: Mon Aug 24, 2015 5:28 pm

Nginx only. How to upgrade to PHP7 FPM?
  • Quote

Post by delebash » Fri Jun 17, 2016 3:42 am

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.
Top

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

Re: Nginx only. How to upgrade to PHP7 FPM?
  • Quote

Post by SS88 » Wed Jun 22, 2016 1:06 pm

Did you restart PHP-FPM?
Top

delebash
Posts: 22
Joined: Mon Aug 24, 2015 5:28 pm

Re: Nginx only. How to upgrade to PHP7 FPM?
  • Quote

Post by delebash » Fri Jun 24, 2016 2:57 am

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

Code: Select all

fastcgi_pass    127.0.0.1:9001;
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

Code: Select all

#fastcgi_pass    127.0.0.1:9001
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
Top

ad73738
Posts: 2
Joined: Mon Oct 14, 2019 11:05 am

Os: Ubuntu 17x
Web: nginx + php-fpm
Re: Nginx only. How to upgrade to PHP7 FPM?
  • Quote

Post by ad73738 » Thu Oct 22, 2020 4:24 pm

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.

Image

How can I setup it so webpages uses php 7.2?
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

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