Install Xampp (php 8.2), with MySQL
https://www.apachefriends.org/download.html
Verify the installation has worked:
- localhost/dashboard
- localhost/phpmyadmin
Setup Custom Local Domains (Simple Host Names)
When developing PHP with Apache on Windows, changing the way you access the site using a custom host name can make it cleaner and easier to access the site, and also allow you to point your site to nested folders, without having to reference those folders in the host name. View the steps for that here >
Get Xampp Running Fast (not slow)
Here’s how to optimise Xampp for faster local performance. Xampp can be known for running slowly (especially for large WordPress sites), but tweaking Xampp settings can make a world of difference. Note it’s ideal to have websites running locally that you can test and tweak.
Use the instructions here to tweak Xampp settings and make it more performant.
Note also, that if you plan to use XDebug, you should be mindful of the impact it can have on performance. See the steps here after your implement XDebug to make sure you limit performance impact.
Setting Up Debugging Ability (XDebug)
Testing everything by refreshing your browser and echoing out results isn’t the best way of developing. Setting up a debug engine in your environment is crucial for better testing, performance and reliability, helping you create more better code faster. You can create break points and stop your app in real time and see what values are being passed around your app.
- Visit https://xdebug.org/wizard and get the right download
- Move the downloaded file to C:\xampp\php\ext, and rename it to
php_xdebug.dll
- Watch this video, it’s a good one: https://www.youtube.com/watch?v=HrQWtbxY1Hs, and will show you how to configure it using your launch.json file
In your php.ini file, add this to the bottom:
[XDebug]
xdebug.mode=debug
xdebug.start_with_request=trigger
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
Note: its possible that XDebug slows down Xampp a lot, see and adjust to your prefs if required
XDebug and its impact on performance
If you’re trying to optimise your Xampp environment (important), then it’s important to consider 3 main states for XDebug, and they can affect the speed of Xampp and your local website development:
- XDebug is off/disabled – no performance impact
- XDebug start_with_request is trigger – some performance impact
- XDebug start_with_request is yes – large performance impact
When XDebug is set to start_with_request=yes
, and you are not actively using breakpoints or stepping through the code in your IDE, the debugging process still impacts performance due to how XDebug hooks into and interacts with PHP’s execution.
Tweak and Test XDebug for Performance
When following the steps here here to tweak Xampp settings and make it more performant, it’s important to also factor in the impact the XDebug extension can have on your environment.
Having the wrong Xampp and XDebug settings can result in an almost stand still to your local development environment, particularly for WordPress and WooCommerce.
See these steps to choose the right XDebug settings for your environment.
Using “start_with_request
=trigger”
Note that when start_with_request=trigger
you may need to do some additional settings to trigger the debug session when you’re running the website through your browser. Using a browser extension can be a good approach:
Browser Extensions: Use a browser extension like XDebug Helper for Chrome or Firefox. These extensions let you easily toggle debugging, profiling, or tracing for the current website. Ensure the extension is configured to communicate with your IDE’s key.
[…] you haven’t got XDebug setup, it’s definitely worth it. See a previous post here on how to setup XDebug on a Xampp installation, here. And checkout the official documentation […]