Xdebug Ubuntu 18.04和PHP7.2
我刚刚将Ubuntu更新到18.04版,我有7.2版的PHP,如果我执行命令“PHP-v”,我会得到这个结果Xdebug Ubuntu 18.04和PHP7.2,php,linux,phpstorm,xdebug,Php,Linux,Phpstorm,Xdebug,我刚刚将Ubuntu更新到18.04版,我有7.2版的PHP,如果我执行命令“PHP-v”,我会得到这个结果 root@laptop1:/etc/apache2/sites-enabled# php -v PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Ze
root@laptop1:/etc/apache2/sites-enabled# php -v
PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.3-1ubuntu1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
root@laptop1:/etc/apache2/sites-enabled#
但是,如果我通过web浏览器在php文件中运行phpinfo()
命令,我会得到以下结果:它告诉我我有php的7.1版,并且没有激活Xdebug
由于这个原因,Xdebug不能与我的PhpStorm IDE一起工作;我不知道是否最好的选择是删除所有安装的PHP版本,留下一个不如7.0或7.1最新的版本。在终端中使用的PHP版本与web服务器(例如apache2)使用的版本之间存在差异。如果您有apache2,可以使用以下命令将PHP版本更改为7.2: Dissable PHP 7.1:
sudo a2dismod php7.1
启用PHP 7.2:
sudo a2enmod php7.2
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.2-fpm
在重启apache2之后:
sudo service apache2 restart
这与Linux、PhpStorm或XDebug有什么关系?显然,您的CLI版本的PHP使用的版本与Web服务器的版本不同