此文属于ubuntu下php开发环境搭建系列
在这之前,已整理过两篇,分别如下:
《Ubuntu+Apache2 + mysql + php5 + netbeans 7.1.1 PHP》
xdebug,一个强大的代码调试工具;meld,一个强大的linux代码对比工具
安装方法如下:
Xdebug安装
*注:ubuntu下xdebug的安装方法网络上还是有很多的,如果你照着下面的安装步骤没有成功安装,你也可以选择其他的方法进行安装.
1.下载xdebug
官网地址:http://xdebug.org/download.php
2.下载合适的xdebug版本
查看http://xdebug.org/wizard.php,即将你机子上的phpinfo的信息粘帖到表单里面进行检测,之后点击“Analyse my phpinfo() output”,会生成如下的安装步骤文档:
3.安装步骤文档如下
But here are the instructions anyway:
1. Download xdebug-2.2.1.tgz
2. Unpack the downloaded file with tar -xvzf xdebug-2.2.1.tgz
3. Run: cd xdebug-2.2.1
4. Run: phpize
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
5. Run: ./configure
6. Run: make
7. Run: cp modules/xdebug.so /usr/lib/php5/20090626+lfs
8. Update /etc/php5/apache2/php.ini and change the line
zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
9. Restart the webserver
两点说明:
1).若安装步骤中(sudo phpize),出现问题(具体问题有点模糊了),运行下面命令:
sudo apt-get install php-dev;
2).执行一些命令时,前面记得加上sudo
4.再次配置php.ini文件
cd /etc/php5/apache2/
sudo vi php.ini
#在该文件底部添加(或更改)成:
[xdebug]
zend_extension = /usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
#保存之后,重启apache2:
sudo service apache2 restart
5.netbeans下xdebug的配置
打开 工具->选项,切换到php选项卡,点击调试,配置如下图:
![](https://img-my.csdn.net/uploads/201209/23/1348410482_5032.png)
linux(ubuntu)代码对比工具Meld的安装:
1.官网:http://meldmerge.org/features.html
2.安装方法:sudo apt-get install meld
3.启动:按下WIN键,在弹出的搜索框中输入meld 即:应用程序 → 编程