I've found a more modern and easier solution partially based on CrasyCoder's post. The steps you need to do are the following:

  1. If your brand new php installation doesn't contain php.ini, rename the php.ini-development to php.ini
  2. Install xdebug with help of the wizard: http://xdebug.org/wizard.php Follow its recommendations literally.
  3. Put in your php.ini the string: xdebug.remote_enable=1
  4. Go to PhpStorm's settings: settings->php. Select or reselect directory containing php. Make sure you see 'Debugger: Xdebug x.x.x' string (where x.x.x stands for installed version)
  5. Install an extension for your favorite browser from here: http://xdebug.org/docs/remote
  6. From the main menu (not the settings window) go to 'Run->Edit configurations' and add new 'PHP Built-in Web Server' configuration. Point the 'Document root' to your project's directory. Note the port number.
  7. Chrome browser: enable the extension pressing on the little bug in the rightmost side of the omnibox and selecting the Debug option. Other browsers' extensions should work similarly.
  8. In PhpStorm's menu enable the 'Run -> Start Listen for PHP Debug connections' option.
  9. Set a breakpoint in your code in PhpStorm.
  10. Run (not debug) the configuration you created in step 6.
  11. In your browser go to localhost:port where 'port' is the port from step 6. Your PhpStorm should stop on the breakpoint and you can start squashing bugs in your code.

Considering that:

Steps 1-5 are made once per php installation.
Step 6 is made once per PhpStorm project.
Steps 7-8 are made once per debuggin session.
Steps 9-11 are made each program run.

Answer from Evgeny Lukianchikov on Stack Overflow
Top answer
1 of 8
41

I've found a more modern and easier solution partially based on CrasyCoder's post. The steps you need to do are the following:

  1. If your brand new php installation doesn't contain php.ini, rename the php.ini-development to php.ini
  2. Install xdebug with help of the wizard: http://xdebug.org/wizard.php Follow its recommendations literally.
  3. Put in your php.ini the string: xdebug.remote_enable=1
  4. Go to PhpStorm's settings: settings->php. Select or reselect directory containing php. Make sure you see 'Debugger: Xdebug x.x.x' string (where x.x.x stands for installed version)
  5. Install an extension for your favorite browser from here: http://xdebug.org/docs/remote
  6. From the main menu (not the settings window) go to 'Run->Edit configurations' and add new 'PHP Built-in Web Server' configuration. Point the 'Document root' to your project's directory. Note the port number.
  7. Chrome browser: enable the extension pressing on the little bug in the rightmost side of the omnibox and selecting the Debug option. Other browsers' extensions should work similarly.
  8. In PhpStorm's menu enable the 'Run -> Start Listen for PHP Debug connections' option.
  9. Set a breakpoint in your code in PhpStorm.
  10. Run (not debug) the configuration you created in step 6.
  11. In your browser go to localhost:port where 'port' is the port from step 6. Your PhpStorm should stop on the breakpoint and you can start squashing bugs in your code.

Considering that:

Steps 1-5 are made once per php installation.
Step 6 is made once per PhpStorm project.
Steps 7-8 are made once per debuggin session.
Steps 9-11 are made each program run.

2 of 8
20

It's really simple to get Xdebug working with PhpStorm, just follow this guide carefully. (NOTE: Updated version of the guide is here)

For more advanced topics read this.

🌐
JetBrains
jetbrains.com › help › phpstorm › configuring-xdebug.html
Configure Xdebug | PhpStorm Documentation
January 8, 2026 - In the IDE settings (Ctrl+Alt+S), select Debug under the PHP node to open the Debug page. In the Xdebug area, specify the following settings: Debug port: appoint the port through which the tool will communicate with PhpStorm.
Discussions

Beginner instructions for PHPStorm + XDebug + (XAMPP or Local) needed...
Try docker and ddev . The manual explains everything you need to do to get xdebug working. Been using ddev at work for a while now, and it works like a charm. More on reddit.com
🌐 r/PHPhelp
8
3
December 4, 2023
php - How do I install and configure Xdebug/PhpStorm - Stack Overflow
I'm trying to install Xdebug and PhpStorm as per the following: I have an iMac that I work form where I just write the PHP scripts. I have an Ubuntu 14.04 Server which runs the PHP scripts that I ... More on stackoverflow.com
🌐 stackoverflow.com
October 20, 2017
How to use xDebug with Symfony?
No need for dbgp proxy Are you on MacOs or Linux? On PHPStorm + MacOs, I've stumbled on a bug where the listening port in settings is 9000,9003 but it doesn't work and should be set to 9003 only. Also have you enabled "listening to remote debug connection" in PHPStorm? More on reddit.com
🌐 r/symfony
21
2
October 25, 2023
Best way to use PHPStorm with WSL2

Well VSCode offers remote development: https://code.visualstudio.com/docs/remote/remote-overview

And Jetbrains followed suit: https://blog.jetbrains.com/blog/2021/11/29/introducing-remote-development-for-jetbrains-ides/

More on reddit.com
🌐 r/bashonubuntuonwindows
30
12
December 14, 2021
🌐
JetBrains
jetbrains.com › help › phpstorm › debugging-with-phpstorm-ultimate-guide.html
Debugging with PhpStorm | PhpStorm Documentation
Open the file in the browser. The phpinfo output should contain the Xdebug section: Use PhpStorm (Run | Web Server Debug Validation in the main menu) to validate the installation and configuration of Xdebug on your web server and get suggestions ...
🌐
Pascallandau
pascallandau.com › blog › php7-with-xdebug-2-4-for-phpstorm-on-windows-10
How to setup PHP7 with Xdebug 2.4 for PhpStorm [Tutorial Part 1] | pascallandau.com
August 7, 2016 - Edit C:\Program Files\php7\php.ini and add the line zend_extension = "C:\Program Files\php7\ext\php_xdebug-2.4.0-7.0-vc14-nts-x86_64.dll" You can add the "zend_extension" line simply at the end of the php.ini. Now we should be good to go - or better to debug. Open up the test.php file in PhpStorm ...
🌐
Gcore
gcore.com › home › developers › how to configure xdebug in phpstorm
How to Configure Xdebug in PhpStorm | Step-by-step Guide
April 8, 2025 - If the ‘pecl’ command is not found, run this command: ... On Windows: Visit the Xdebug website, locate the appropriate version for your PHP, download the DLL, and place it in your PHP extensions directory.
🌐
Mageplaza
mageplaza.com › blog › magento 2 › magento 2 devdocs › how to install xdebug php and setup phpstorm via cli without apache
How to Install Xdebug PHP and Setup PHPStorm via CLI without Apache - Mageplaza
March 17, 2025 - Learn how to install Xdebug PHP and set up PHPStorm via CLI without Apache 1. Install X-debug into PHP 2.Configure Xdebug 3. Configure PhpStorm. 4. Testing Xdebug.
🌐
YouTube
youtube.com › ms s payne computing
Setup PhpStorm To User Xdebug in Windows - YouTube
PhpStorm Xdebug Setup In Windows is a guide designed for people who with a correctly working PHP installation including Xdebug. If your system does not have ...
Published   November 22, 2020
Views   7K
Find elsewhere
🌐
Xdebug
xdebug.org › docs › install
Xdebug: Documentation » Installation
How you install Xdebug depends on your system. There are the following possibilities: Linux with a package manager such as apt, yum, or something else. Linux without a package manager, with PIE. ... Windows, through PIE.
🌐
DEV Community
dev.to › orivolfo › installing-xdebug-on-phpstorm-for-dummies-4k8a
Installing Xdebug on PHPStorm for dummies - DEV Community
September 15, 2019 - Go to php.ini file, make sure that xdebug.remote_enable = 1. if you are not sure where is your php.ini file is, and you are using Wamp, you have shortcut from your taskbar: Then: In PHPStorm, go to File | Settings | Languages & Frameworks | PHP and choose:
🌐
GitHub
gist.github.com › ad44d6903ce0a6851df3f418cac6256c
How to use xdebug with PhpStorm · GitHub
* Select Xdebug in the __Debugger__ drop down. * Check the __Use Path Mapping__ checkbox. * Enter the absolute path to your web root directory in the __Absolute path on the server__ section for the webapp directory. * Click __Apply__ and __OK__ buttons. e. Enter "PHPSTORM" in the Ide key (session id) field. f. Check the Activate tool window checkbox.
🌐
Medium
medium.com › @michalisantoniou6 › set-up-xdebug-with-homestead-phpstorm-and-php7-85b5ac8f0c79
Set Up xDebug, with Homestead, PHPStorm and PHP7 | by Michalis Antoniou | Medium
May 11, 2020 - Set Up xDebug, with Homestead, PHPStorm and PHP7 This tutorial will guide you through the process of installing xDebug on your Homestead box, and configuring PHPStorm to listen for xDebug connections …
🌐
SitePoint
sitepoint.com › blog › debugging › how to install xdebug with phpstorm and vagrant
How to Install Xdebug with PHPStorm and Vagrant — SitePoint
November 6, 2024 - Xdebug is a PHP extension that enhances code debugging and profiling, providing detailed stack traces for errors. This tutorial provides a step-by-step guide on setting up Xdebug with PHPStorm for Vagrant hosted PHP apps. The process involves installing and booting Homestead, installing a sample ...
🌐
Roelof Jan Elsinga
roelofjanelsinga.com › roelof jan elsinga › blog › how to enable step debugging in php with xdebug 3 and phpstorm
How to enable step debugging in PHP with Xdebug 3 and PHPStorm - Roelof Jan Elsinga
December 29, 2022 - These are the steps we're going to do to enable step debugging in PHPStorm: ... It's surprisingly simple to enable step debugging for PHP, so let's get started! The first step to enabling step debugging for PHP is to configure Xdebug 3. In this guide, I assume you've already installed PHP and ...
🌐
Lando 3
docs.lando.dev › guides › lando-phpstorm.html
Lando + PhpStorm + Xdebug | Lando 3
March 11, 2025 - Out of the box, PhpStorm is already configured to connect to Xdebug. You shouldn't need to change anything, though you may refine settings to meet your needs in PhpStorm's Settings under Languages and frameworks >> PHP >> Debug. Install the Xdebug helper extension for your browser.
🌐
Reddit
reddit.com › r/phphelp › beginner instructions for phpstorm + xdebug + (xampp or local) needed...
r/PHPhelp on Reddit: Beginner instructions for PHPStorm + XDebug + (XAMPP or Local) needed...
December 4, 2023 -

I have been trying for 2 days to get PHPStorm to work with XDebug and either XAMPP or Local and I just cannot seem to figure it out.

Here's what I would like to do.....

I have a WordPress site that needs some minimal changes to some API calls. I have no problem writing that code. I've written it in plugins and it's running fine. But I wrote that "blind" - as in I just wrote the code in a text editor and uploaded it and it works.

I want to be able to do more serious debugging with a tool like PHPStorm so I can step through the code on the site that I didn't write (and don't completely understand) to learn what it does and possibly fix some PHP errors that I see popping up.

I backed up the production site using UpdraftPlus, downloaded the backup files and restored the production site to a local dev site in XAMPP and I also did the same thing to a local dev site in Local.

Both sites work just like the production site (just a bit slower than the production site running on a Cloudways virtual server). The XAMPP site runs 2 to 6 times faster than the Local site, depending on what you are doing (uploading files or just surfing the site, etc.).

It is at that point that I am failing to do what I need to do. Here is what I need to be able to do....

Load either site into PHPStorm

Open a file in PHPStorm and set a breakpoint

Open a browser and go to the page/button/whatever that triggers the code

Have the code stop at the breakpoint in PHPStorm for inspection/changes

Be able to step through the code from the breakpoint forward, learning what the code is doing

I'd like to use PHPStorm for this, but getting it all set up is like some cruel joke. I've seen examples of people setting up CLI servers, actual servers, assigning PHP executables, etc. in YouTube video after video. Most of the videos are 2 to 10 years old and you might get half done or even 75% done when their UI no longer looks like yours and finding the settings they are tweaking is nigh impossible. Even if you find something that looks similar it's never exactly the same and there are more fields to fill out with no clue what goes in them.

Then there are several different ways that I've seen the php.ini files and Apache settings done. Which is right? Which is best? Who knows? Not me....that's for sure.

Worse yet is the lost feeling when I cannot figure out just how they know even the parts that I can follow along with. I cannot, for the life of me, find a simple "Step 1, Step 2, Step 3...." that is current and works to set this stuff up.

There doesn't seem to be an "Absolute Idiot's Guide to PHP Debugging with PHPStorm and XAMPP" - which is what I think I need at this point.

And it is odd to me that there is no checklist or walk-through plug-in in PHPStorm or VS Code that asks you questions and sets up the environment based on your answers. There isn't even a written checklist that is current and workable that I can find.

It isn't all the fault of the tools (if any at all) though.....I am a full time caregiver for my mother who has Parkinson's. When not doing that I try and care for our dog who has congestive heart failure. When I can get away from those duties I have to maintain the home. And then I need to work - something I try to do from home as much as humanly possible because there is nobody to stay with my mother (who has fallen on occasion and needs someone nearby). The only undisturbed time I have to study any of this is when they are asleep (and I should be sleeping). So it is entirely possible that I am just worn completely out and cannot see the forest for the trees.

Be that as it may, I still am desperate to get this job done. I have 3 weeks to do it and if I can't get this unholy trio of PHPStorm/VS Code, XAMPP/Local and Xdebug to somehow come together into something useful, I don't see how I will make that deadline.

It isn't for lack of looking that I haven't figured it out....I've watched/read over 70 videos/articles and so far they all fail to produce the desired result.

🌐
Drupal
drupal.org › docs › 7 › modules › govcms › how-to-setup-xdebug-with-phpstorm
How to setup Xdebug with PHPStorm | GovCMS | Drupal Wiki guide on Drupal.org
July 3, 2021 - Configure PHPStorm “Servers” and add path mapping between local folder to the remote folder. NOTE: Your theme might be in a different place. For me it was under /app/sites/default/themes/custom/oa_theme/, this is important if you want to debug in your theme's template.php for example. Install and enable Xdebug ...
🌐
Medium
medium.com › @chirag1162 › how-to-setup-xdebug-for-laravel-in-phpstorm-050cc0f361da
How to setup Xdebug for Laravel in PHPSTORM | by Chiragkumar Patel | Medium
April 4, 2024 - Install PHPStorm, a popular IDE for PHP development. Install Xdebug: Depending on your PHP version, install Xdebug using PECL or Composer.
🌐
Mageplaza
mageplaza.com › blog › magento 2 › magento 2 tutorials › how to set up xdebug in phpstorm | phpstorm documentation
How to Set up Xdebug in PhpStorm | PhpStorm Documentation - Mageplaza
March 17, 2025 - Then, install the Xdebug extension compatible with your PHP version. You can use the following command: ... You will see the Xdebug with that version. ... sudo gedit /etc/php/8.3/mods-available/xdebug.ini or sudo nano /etc/php/8.3/mods-avai...
🌐
Stack Overflow
stackoverflow.com › questions › 46847902 › how-do-i-install-and-configure-xdebug-phpstorm
php - How do I install and configure Xdebug/PhpStorm - Stack Overflow
October 20, 2017 - I have followed several guides and have installed Xdebug properly, sudo apt-get install php5-xdebug. I have also edited the php.ini file so that the following text appears in my phpinfo file: "with Xdebug v2.2.3". I added the following lines ...
🌐
Medium
medium.com › ekino-france › xdebug-configuration-phpstorm-docker-desktop-817da3005556
Xdebug Configuration — PhpStorm / Docker | by Arthur Gorden | ekino-france | Medium
October 18, 2024 - Open PhpStorm’s settings. "Cmd" + "," on Mac "Ctrl" + "," on Linux and Windows · Then, unfold PHP and click on Debug. In the Xdebug part, keep the 9003 port (Xdebug’s port for version 3 and more).