Xdebug not working with PHPStorm
Solution 1
Try to configure your project in PhpStorm
- Open Settings->Languages & Frameworks->PHP->Debug
- Uncheck the "Ignore external connections through unregistered server configurations" option
- OK
Solution 2
Add to your php.ini:
xdebug.mode=debug
Solution 3
I was having the same issue, below are the steps I performed to resolve it:
- Make sure you have xdebug installed and in php.ini uncomment
xdebug.mode=debug
- Open Settings->Languages & Frameworks->PHP->Debug, Assign Debug Port value, you can find this port from php.ini. In my case, it was 9002
- Now Validate debugger configurations - here you need to add the path to your web application files and URL. Click validate.
- Now Start Listening -> Enable listening for PHP Debug Connection.
After this setup you can set a break point and start debugging with XDEBUG.
Dave
I am a software engineer that specializes in MVC PHP web applications. I am the author of Opulence - an open source PHP framework, and a commercial pilot and flight instructor. Languages: PHP, JavaScript/AngularJS/jQuery, HTML, CSS, C#, VB.NET, MySQL, PostgreSQL
Updated on June 05, 2022Comments
-
Dave almost 2 years
I use PHPStorm along with Xdebug to step through my code. PHPStorm is running on a Windows 7 machine, and my local webserver is running on a separate CentOS 6.4 machine. I've done a
phpinfo();
to verify that Xdebug is being loaded by PHP, and it is. The following are the settings for my Xdebug in the PHP.ini:[xdebug] zend_extension="/usr/lib/php/modules/xdebug.so" xdebug.remote_enable = 1 xdebug.remote_port = 9000 xdebug.remote_host = "192.168.1.130" xdebug.remote_log = "/var/log/httpd/xdebug_log"
I similarly setup PHPStorm to use my CentOS server as the debugging server, and I listen for connections. I assigned static IPs to both of these machines. Using a Chrome Xdebug plugin to set the appropriate cookies, I attempt to set a breakpoint, but nothing happens. When I go to look in /var/log/httpd/xdebug_log (which has 777 permissions), nothing is written there. I've opened up port 9000, and I can telnet from my CentOS machine back to my Windows machine on port 9000 no problem. I also set SELinux to permissive, but to no avail.Any ideas what could be happening here?