Installing and Configuring Xdebug for PHP with PhpStorm Debugging
This guide explains how to download the appropriate Xdebug DLL, place it in the PHP extensions directory, configure php.ini with the required Xdebug settings, restart Apache, verify installation via phpinfo, and set up PhpStorm for remote debugging, including cleanup steps.
First, copy the output of phpinfo() into the Xdebug Wizard to download the matching php_xdebug-2.6.0-7.2-vc15-x86_64.dll file.
Place the downloaded DLL into the PHP ext directory (e.g., D:\phpTools\php7\ext ).
Append the following Xdebug configuration to the end of php.ini :
<code>;; phpstorm的debug调试设置
[XDebug]
zend_extension = "D:\phpTools\php7\ext\php_xdebug-2.6.0-7.2-vc15-x86_64.dll" ;xdebug.dll的路径
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "\phpTools\php7\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000</code>Save the file and restart Apache. Visiting the phpinfo() page should now show Xdebug information, confirming successful installation.
In PhpStorm, configure the debug settings to use the same port (9000) and set up a server mapping that points the project URL to the correct local path.
After applying the settings, click OK and start a debugging session; PhpStorm will now intercept breakpoints.
Once debugging is complete, it is recommended to remove the temporary Xdebug configuration from php.ini and PhpStorm to avoid unintended performance impact.
Images in the original article illustrate each step, such as the Xdebug wizard page, the DLL copy location, the php.ini edit screen, the phpinfo verification, and the PhpStorm debug configuration dialogs.
php中文网 Courses
php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.