Ubuntu 16.04 上 PHP 5.6 的 Xdebug [英] Xdebug for Php 5.6 on Ubuntu 16.04

查看:44
本文介绍了Ubuntu 16.04 上 PHP 5.6 的 Xdebug的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 Ubuntu 16.04 上为 Php5 安装 Xdebug?我尝试以与 ubuntu 14.04 相同的方式安装它,但是每次我尝试安装 php5-dev 时都会收到此错误E:Package 'php5-dev' 没有安装候选"

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"

推荐答案

你可以通过输入

sudo apt-get install php-xdebug

然后只重启apache

then only restart apache

sudo service apache2 restart

或者如果你使用 NGINX

or if you use NGINX

sudo systemctl restart nginx

或须藤nginx重启

如果您现在查看 phpinfo() 输出,您应该会看到 xdebug.

If you now look at your phpinfo() output, you should see the xdebug.

如果您通过 ppa:ondrej/php Packages 安装了 PHP 5.5 或 5.6,这也适用

This als wokrs if u installed PHP 5.5 or 5.6 via ppa:ondrej/php Packages

要通过 apt-get 安装 PHP5 版本,请查看此 guid Ubuntu 添加ondrej/php

To install PHP5 version by apt-get look this guid Ubuntu add ondrej/php

问候

这里是 Xdebug 与 PHPStorm 和浏览器一起使用的配置.

Here the config for Xdebug to use it with PHPStorm and the Browser.

将以下行添加到/etc/php//apache2/conf.d/20-xdebug.ini

Add the following lines to /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

这将仅在远程启动 xdebug,并允许您通过 PHPStorm 快速调试(也应与其他 IDE 一起使用)

This will start xdebug only at remote and allows you fast to debug by PHPStorm (should also work with other IDE's)

这篇关于Ubuntu 16.04 上 PHP 5.6 的 Xdebug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆