PHP
Tips
GUI
Tips and Tricks
PHPStorm
X-Debug

Do you have a problem in 2023 that sometimes PHP Storm wont work with X debug 3

by Vladimir Nikolic, CEO Coding Wisely

Debugging your PHP code is an essential part of the development process. PHPStorm and XDebug 3 are powerful tools that can help you debug your code efficiently.

However, sometimes you may encounter an issue where the debugger never stops on a breakpoint. Here are some steps you can take to troubleshoot this issue.

First, check if XDebug is installed on your system by running the command php --version.

If it is not installed, you can install it using PECL by running the command pecl install xdebug.

Next, make sure that you have set the correct PHP.ini directives for XDebug. You can do this by adding the following lines to your PHP.ini file:

zend_extension="xdebug.so"
[xdebug]
xdebug.mode=debug
xdebug.client_port=9003
xdebug.client_host=127.0.0.1

After making changes to your PHP.ini file, make sure to restart your server to apply the changes. You can check if XDebug is properly loaded by running the command php -r "xdebug_info();". This will display information about the XDebug extension.

Make sure that the XDebug extension for your browser is installed and running.

Browser extension

This will allow PHPStorm to communicate with the browser and stop on breakpoints.

In PHPStorm, make sure that the debugger is listening by clicking on the little bug button. If the button is green, it means that the debugger is listening.

Listening

If you have followed all these steps and the debugger still does not stop on breakpoints, it may be an issue with your project settings in PHPStorm.

Check if you have set up a server in PHPStorm under PHP/Servers.

Servers

If you have, try deleting the server and reloading the page you are trying to debug. This should fix the issue.

Debugging can be a frustrating process, but with these steps, you should be able to troubleshoot the issue and get back to coding.

Happy debugging!

About the Author:

Vladimir, with over 25 years in the software industry, serves as the CEO of Coding Wisely.

Disclaimer:

The information provided in this article is based on the author's knowledge and experience as of the publication date. Technology and tools may have evolved since then. Always refer to the official documentation for the latest instructions and updates.