Ubuntu 16.04 上 PHP 5.6 的 Xdebug
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38370395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xdebug for Php 5.6 on Ubuntu 16.04
提问by Samar
Is There is a way to install Xdebug for Php5 on Ubuntu 16.04? I've tried to install it the same way as ubuntu 14.04 but every time I try to install php5-dev I get this error "E: Package 'php5-dev' has no installation candidate"
有没有办法在 Ubuntu 16.04 上为 Php5 安装 Xdebug?我尝试以与 ubuntu 14.04 相同的方式安装它,但是每次我尝试安装 php5-dev 时都会收到此错误“E:Package 'php5-dev' 没有安装候选”
回答by ZFNerd
you can install xdebug by typing in
您可以通过键入安装 xdebug
sudo apt-get install php-xdebug
then only restart apache
然后只重启apache
sudo service apache2 restart
or if you use NGINX
或者如果你使用 NGINX
sudo systemctl restart nginx
or sudo nginx restart
或 sudo nginx 重启
If you now look at your phpinfo() output, you should see the xdebug.
如果您现在查看 phpinfo() 输出,您应该会看到 xdebug。
This als wokrs if u installed PHP 5.5 or 5.6 via ppa:ondrej/php Packages
如果您通过 ppa:ondrej/php Packages 安装了 PHP 5.5 或 5.6,这也适用
To install PHP5 version by apt-get look this guid Ubuntu add ondrej/php
要通过 apt-get 安装 PHP5 版本,请查看此 guid Ubuntu 添加 ondrej/php
Greetings
你好
Edit: Here the config for Xdebug to use it with PHPStorm and the Browser.
编辑:这里 Xdebug 的配置与 PHPStorm 和浏览器一起使用。
Add the following lines to /etc/php//apache2/conf.d/20-xdebug.ini
将以下行添加到 /etc/php//apache2/conf.d/20-xdebug.ini
xdebug.remote_host = localhost
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
This will start xdebug only at remote and allows you fast to debug by PHPStorm (should also work with other IDE's)
这将仅在远程启动 xdebug 并允许您通过 PHPStorm 快速调试(也应该与其他 IDE 一起使用)