update-alternatives で OK かなと思ったのですが,
$ sudo update-alternatives --config php There are 2 choices for the alternative php (providing /usr/bin/php). Selection Path Priority Status -------------------- * 0 /usr/bin/php7.0 70 auto mode 1 /usr/bin/php5 50 manual mode 2 /usr/bin/php7.0 70 manual mode Press <enter> to keep the current choice[*], or type selection number: 0 $ php -v PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.30-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
apache では php5 のままです.
$ w3m -dump http://localhost/phpinfo.php|grep -m1 'PHP Version' PHP Version 5.6.30-0+deb8u1
apache module を切り替えたらokでした.
$ sudo a2dismod php5 $ sudo a2enmod php7.0 $ systemctl restart apache2
環境
$ dpkg-query -W apache2 php5 libapache2-mod-php5 php7.0 libapache2-mod-php7.0 apache2 2.4.25-3+deb9u5 libapache2-mod-php5 5.6.30+dfsg-0+deb8u1 libapache2-mod-php7.0 7.0.30-0+deb9u1 php5 5.6.30+dfsg-0+deb8u1 php7.0 7.0.30-0+deb9u1 $ lsb_release -d Description: Debian GNU/Linux 9.5 (stretch) $ uname -m x86_64