ubuntu禁用debug,是否可以在Ubuntu上使用xdebug?

I am trying to debug some PHP code and wanted to download the XDebug debugger for PHP. All I see there is Windows binaries for downloading. Is it at all possible to use it on Ubuntu?

解决方案

Execute the following commands in your terminal.

Download Xdebug - you will need to follow alternate instructions if you don't have PHP5 working on your machine already.

sudo apt-get install php5-xdebug

The package should modify your INI file for you, but just in case you need to edit it yourself open it up and make the following modification - on Ubuntu its typically at /etc/php5/apache2/php.ini - add the following line.

zend_extension="/usr/lib/php5/20110331/xdebug.so"

That path might be a little different on your system - just make sure its a fully qualified path to the xdebug.so file on your machine. Also remember to comment out any references to the Zend Debugger - you can't run both at the same time.

Now restart Apache.

sudo /etc/init.d/apache2 restart

You may also need want enable html_errors. Search for html_errors in /etc/php5/apache2/php.ini and make sure it is set to On. A restart of Apache is also required.

html_errors = On

Double-check with phpinfo() to make sure that everything is installed properly - you may also want to set configurations for Xdebug in your php.ini file.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值