Backend Development 6 min read

Setting Up a PHP Development Environment with XAMPP and Xdebug

This guide walks through installing XAMPP, configuring MySQL and PHP, setting up Xdebug, and integrating PhpStorm to create a complete PHP development and debugging environment for beginners.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Setting Up a PHP Development Environment with XAMPP and Xdebug

PHP is a powerful, open‑source server‑side scripting language, and this tutorial shows how beginners can quickly set up a PHP debugging environment using XAMPP and Xdebug.

Installing XAMPP : Download the latest XAMPP package for Windows, extract it, and run the installer with default components (Apache, MySQL, PHP, Perl). After installation, start the Apache service via the XAMPP control panel and verify the server by opening http://localhost in a browser.

Configuring the Database : Use phpMyAdmin (included with XAMPP) to manage MySQL. If the default root user has no password, you can set one by opening a command prompt, navigating to C:\xampp\mysql\bin , and running mysql -u root followed by the appropriate SET PASSWORD command. Update config.inc.php in the phpMyAdmin directory if needed.

Running PHP Files : Place your PHP scripts in C:\xampp\htdocs . If an index.php file exists, it will be served automatically; otherwise, browsing to http://localhost shows the directory listing.

Installing Xdebug : Download the Xdebug build that matches your PHP version (thread‑safe) from https://xdebug.org/download . Copy the resulting .dll file into the ext folder of your PHP installation and add zend_extension="path\to\php_xdebug.dll" to php.ini . Verify the installation by opening http://localhost/dashboard/phpinfo.php and checking for the Xdebug section.

Setting Up PhpStorm : Install PhpStorm, then configure the interpreter (File → Settings → PHP) to point to D:\XAMPP\php\php.exe . Add a server entry (File → Settings → PHP → Servers) with name localhost , host localhost , port 80 , and debugger Xdebug . In the Debug settings, set the port to 9000 and ensure the IDE key is PHPSTORM . Install the “Xdebug helper” Chrome extension and set its IDE key to PHPSTORM .

Debugging : In PhpStorm, enable the listening button, set breakpoints in your PHP code, and start a debug session via the Chrome extension. When the script runs, PhpStorm will pause at breakpoints, showing variable values and call stacks, confirming that the debugging environment works correctly.

debuggingBackend DevelopmentPHPidexdebugPhpStormXAMPP
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.