2

我试图在我的 ubuntu 服务器机器上安装 xdebug,但它不工作。我知道它不起作用的原因是 var_dump 的输出没有着色,我也无法使用 netbeans 连接到它。

我遵循了关于如何安装 xdebug 的定制说明

http://xdebug.org/wizard.php

这是我的 phpinfo 分析的输出:

Xdebug installed: no
Server API: Apache 2.0 Handler
Windows: no
Zend Server: no
PHP Version: 5.3.6-13
Zend API nr: 220090626
PHP API nr: 20090626
Debug Build: no
Thread Safe Build: no
Configuration File Path: /etc/php5/apache2
Configuration File: /etc/php5/apache2/php.ini
Extensions directory: /usr/lib/php5/20090626

向导推荐的文件名是 xdebug-2.1.4.tgz

phpize 的输出是

Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

我的 phpinfo 现在确实显示已安装 xdebug,如下所示:

在此处输入图像描述

这是我的 php.ini 中的内容

zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.profiler_output_dir = "/var/log/apache2/xdebug"
xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.profiler_enable =1
xdebug.profiler_append=1
xdebug.extended_info=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_host=192.168.2.13
xdebug.remote_port=9000
;xdebug.idekey=xdebug
xdebug.idekey=netbeans-xdebug
xdebug.remote_connect_back=1
xdebug.remote_log="/var/log/apache2/xdebug_remote.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0

lsb_release -a 在我的电脑上的输出是

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 11.10
Release:        11.10
Codename:       oneiric

phpinfo 上显示的 PHP 版本是 5.3.6-13ubuntu3.6

4

1 回答 1

4

对于颜色,您可能还想html_errors=1在 php.ini 中进行设置。

至于 netbeans 问题(你真的不应该将问题组合在一个问题中!),你的机器运行 PHP 有哪些 IP 地址,运行 netbeans 的机器有哪些 IP 地址?xdebug.remote_host 设置应该包含正在运行的 netbeans 的 IP 地址。您正在生成的远程日志文件中也应该有连接尝试。

于 2012-05-02T09:14:47.797 回答