linux php5.3 xdebug,Linux安装php-xdebug扩展

解压、安装

tar -zxvf xdebug-2.4.0.tgz

phpize

./configure

make

make install

修改配置文件

sudo mkdir /usr/local/lib/php5-ext

sudo mv /tmp/xdebug-2.5.5/modules/xdebug.so /usr/local/lib/php5-ext/

php5-fpm -i | grep php.ini

sudo vim /etc/php5/fpm/php.ini

在文件末尾加入

[xdebug]

zend_extension="/usr/local/lib/php5-ext/xdebug.so"

ps:xdebug常用配置项说明,https://xdebug.org/docs/all_settings#auto_trace

php5-fpm -i | grep xdebug 查看是否成功

在php文件中使用xdebug调试

$a = 'hello';

xdebug_debug_zval('a');

a:

(refcount=1, is_ref=0),string 'hello' (length=5)

todo

xdebug具体调试用例

Once you have access to phpize and php-config, do the following:

Unpack the tarball: tar -xzf xdebug-2.4.x.tgz. Note that you do not need to unpack the tarball inside the PHP source code tree. Xdebug is compiled separately, all by itself, as stated above.

cd xdebug-2.4.x

Run phpize: phpize (or /path/to/phpize if phpize is not in your path).

./configure --enable-xdebug (or: ../configure --enable-xdebug --with-php-config=/path/to/php-config if php-config is not in your path)

Run: make

cp modules/xdebug.so /to/wherever/you/want/it

add the following line to php.ini: zend_extension="/wherever/you/put/it/xdebug.so"

Restart your webserver.

Write a PHP page that calls phpinfo();. Load it in a browser and look for the info on the xdebug module. If you see it, you have been successful!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值