ubutun14.10安装xdebug

本文介绍如何在Ubuntu上安装Xdebug,并通过详细的步骤指导完成配置过程,确保PHP能够正确识别Xdebug,以便进行有效的代码调试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Need to install xdebug on Ubuntu so you can test that really cool PHP web app that will wow users for a decade? The first thing you need to achieve that goal is have Ubuntu installed and the lamp stack ready to go. Next open the terminal and install xdebug by using the following command.

~$ sudo apt-get install php5-xdebug

Next open the php ini file on Ubuntu so that we can ensure that xdebug is being seen by the PHP engine, again from the terminal ensure you have vim installed or you can use gedit and open php.ini file

~$ sudo vim /etc/php5/apache2/php.ini 

At the bottom of the file add the following make sure you test the path to the xdebug.so module as it does change. Always look through the php.ini and ensure that any reference to Zend Debugger is also commented out.

# Added for xdebug
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp 
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1 
xdebug.remote_port=9000

Now restart Apache.

~$ sudo service apache2 restart

To ensure that all is working well I have attached a phpinfo() file, add it to the root directory of your local website development machine, usually the default for Ubuntu is /var/www and if everything is working you should get something like the image below in your browser

xdebug php info

139 bytes
   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值