I had a hard time trying to install Xdebug on Ubuntu 13.10. Luckily, Damian helped me last weekend at the Magento Hackathon in Leipzig – thanks again! Now I wanted to share the knowledge and explain, how you can easily install and use Xdebug on Ubuntu – especially together with PhpStorm.
- Install the php5-xdebug package:
sudo apt-get install php5-xdebug
- Create the xdebug.ini configuration file:
sudo vim /etc/php5/conf.d/xdebug.ini
With the following content (make sure that the path to the extension is correct):
zend_extension=/usr/lib/php5/20121212/xdebug.so xdebug.remote_host = localhost xdebug.remote_enable = 1 xdebug.remote_port = 9000 xdebug.remote_handler = dbgp xdebug.remote_mode = req
- Configure your IDE to use Xdebug. In PhpStorm go to File – Settings – PHP – Debug. Make sure that under „Xdebug“ the port is set to 9000 and all three checkboxes are ticked. Then go to Run – Edit Configurations – PHP Remote Debug. Select the correct server or create one and make sure that the debugger is set to „Xdebug“. You may want to use path mappings if you use symlinks like in a modman-environment.
- Install an Xdebug extension for your browser – I decided to use „Xdebug Helper for Firefox“ in Firefox and Xdebug helper for Chrome.
- Use it 🙂 In PhpStorm, set a break point by clicking on the left hand bar of the code, press the „Start Listen PHP Debug Connections“ button in the top menu bar, open the page you want to debug with Firefox, click the „Enable Debug“ icon in the bottom bar and reload the page. PhpStorm should then get the focus again and a debug perspective should appear.
Happy debugging!
Hello.
This was the only way I could get xdebug installed and running. All describtions from xdebug website etc. didn’t work. But when installing phpmyadmin I get this error: http://bugs.xdebug.org/view.php?id=916
phpize –version output:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
System Info from phpinfo():
Linux MF-UBUNTU 3.8.0-34-generic #49~precise1-Ubuntu SMP Wed Nov 13 18:05:00 UTC 2013 x86_64
PHP Version 5.4.22-1+debphp.org~precise+1
Apache 2.2.22
Any ideas what the problem is?
Happy to hear that it helped. Unfortunately, I do not know what the problem is, sorry. Maybe you find help at the xdebug / phpMyAdmin support…
On netbeans-ubuntu-13.10, this was what works:
http://stackoverflow.com/questions/20277240/netbeans-waiting-for-connection-to-xdebug
Thanks for sharing the knowledge and for explaining all the entire process. Your description is clear enough.