Different versions of php in the console and in the browser, as to lead to the same?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
19 views
Hello

Is php 5.6 fpm and nginx. I had to add php-fpm 7 - installed, and now in the console I have always used php cli 7.0

walk@BCS-204-711-2:~$ sudo service php7.0-fpm start
walk@BCS-204-711-2:~$ php-v


PHP 7.0.29-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Apr 5 2018 08:34:50) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.29-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans


walk@BCS-204-711-2:~$ sudo service php7.0-fpm stop
walk@BCS-204-711-2:~$ sudo service php5.6-fpm start
walk@BCS-204-711-2:~$ php-v


PHP 7.0.29-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Apr 5 2018 08:34:50) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.29-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans


It is necessary that when you turn used the php 5.6 5.6 cli and when enabled 7.0 - 7.0 cli. How to do it?

PS In the browser (phpinfo()) version changes follow.
by | 19 views

3 Answers

0 like 0 dislike
Use in console: php7.1
Or to use plain php, run: update-alternatives --config php

And in the web (fpm) they did not interfere and normally live nearby.
by
0 like 0 dislike
php7.0
Binary you can look for a team
whereis php7.0
by
0 like 0 dislike
In principle, you can try to change php7.0-fpm.service and php5.6-fpm.service to create a symlink to the desired version of php-cli. I hope the idea is clear
by
110,608 questions
257,187 answers
0 comments
40,796 users