B
B
BloodVIRUS2018-08-21 09:48:55
PHP
BloodVIRUS, 2018-08-21 09:48:55

How to upgrade php from 5.5.9 to 7.0?

Hello. Lived, did not grieve, used php version 5.5.9. But there was a need to use some libraries that require php 7th. I installed php7 using this manu: https://losst.ru/ustanovka-php-7-v-ubuntu-2
And everything seems to be up and running. But nginx still uses php 5.5.9.
How to switch it? I go to update-alternatives --config php, make php7 by default, stop /etc/init.d/php5-fpm stop - php crashes. At the same time, /etc/init.d/php7.0-fpm start
start: Job is already running: php7.0-fpm
7th works. I stop the 7th, start it again - php does not work, all the sites are lying. I start php5 - everything rises again, but on the 5th version of php.
nginx version 1.4.6
UPD
Strange, in the php console it shows the 7th version:
php -v
PHP 7.0.31-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jul 25 2018 10:12:07) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.31-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
BloodVIRUS, 2018-08-21
@BloodVIRUS

As it turned out, for each site config you can run your own version of php.
It is necessary to change fastcgi_pass to unix:/var/run/php/php7.0-fpm.sock in nginx config;

P
Pavel, 2018-08-21
@PavelMonro

Disable Php 5 and enable 7
And vice versa

sudo a2dismod php7.0 ; sudo a2enmod php5.5 ; sudo service nginx restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question