Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 8171  / 3 Years ago, thu, june 3, 2021, 12:55:23

I upgraded PHP from Version 7.0.27 to 7.2 on ubuntu16.04 with nginx.



PHP 7.0 to PHP 7.2 - How to upgrade your server



When I run php -v on terminal, I can see:



PHP 7.2.2-3+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Feb  6 2018 16:11:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.2-3+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans


But when I see in browser echoing phpinfo(), it shows the older version of PHP like:



PHP Version 7.0.27-1+ubuntu16.04.1+deb.sury.org+1


That means nginx is not using PHP7.2
Where I need to configure for this.
Please, any help is appreciated.



Thanks in advance.


More From » php

 Answers
4

To augment Thomas' answer, this is the file you need to change:



sudo nano /etc/nginx/sites-available/default


or if you are running several sites on one nginx:



sudo nano /etc/nginx/sites-available/your_site_name


change this part in it



server {

...

location ~ .php$ {
...
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}

...
}


php7.0-fpm.sock to php7.2-fpm.sock


[#8953] Saturday, June 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rmiend

Total Points: 292
Total Questions: 101
Total Answers: 111

Location: Azerbaijan
Member since Tue, Aug 9, 2022
2 Years ago
;