Software⏱️ 4 min read📅 2026-06-19

How to Fix: how I can set Xdebug in php.ini for my mini server to seen the error in uniserver?

Setting up Xdebug in php.ini for UniServer to display errors.

Quick Answer: Enable remote debugging and set the correct port in your php.ini file.

The issue you are experiencing is related to Xdebug not being properly configured on your UniServer setup, preventing you from seeing error messages in your PHP code. This affects anyone who has enabled Xdebug on their server and is trying to debug their PHP applications.

This frustration can be particularly challenging when trying to identify and fix errors in your code, especially when working with a development environment like UniServer. However, don't worry, we're here to help you troubleshoot and resolve this issue.

🛑 Root Causes of the Error

  • The primary reason for this issue is that Xdebug is not properly configured in the php.ini file. The configuration options are set incorrectly, preventing Xdebug from functioning correctly.
  • Another possible cause could be related to the UniServer setup itself, where the PHP extensions or directories are not properly configured.

🚀 How to Resolve This Issue

Configuring Xdebug in php.ini

  1. Step 1: Open your php.ini file and locate the xdebug section. Ensure that the zend_extension option is set to point to the correct location of the php_xdebug.dll file (C:/UniServer/usr/local/php/extensions/php_xdebug.dll).
  2. Step 2: Set the xdebug.remote_autostart option to 'on' to enable automatic startup of Xdebug when a request is received.
  3. Step 3: Set the xdebug.remote_enable option to 'on' to enable remote debugging.
  4. Step 4: Set the xdebug.remote_host option to '127.0.0.1' to specify that Xdebug should listen on localhost.
  5. Step 5: Set the xdebug.remote_port option to '9000' to specify the port number that Xdebug will use for remote connections.
  6. Step 6: Set the xdebug.remote_handler option to 'dbgp' to specify the protocol used for remote debugging (in this case, DBGP).
  7. Step 7: Set the xdebug.remote_mode option to 'req' to specify the mode of operation for Xdebug (in this case, request-based).
  8. Step 8: Finally, set the xdebug.idekey option to 'default' to specify a unique identifier for your IDE.
  9. Step 9: Save the changes to the php.ini file and restart your UniServer service to apply the new configuration.

Alternative Fix Method: Checking UniServer Setup

  1. Step 1: Check your UniServer setup to ensure that PHP extensions are properly configured. Verify that the PHP extension directory is set correctly and that the php_xdebug.dll file is present in the correct location.
  2. Step 2: Verify that the PHP directories and extensions are properly configured in the UniServer settings. This may involve checking the PHP extension directory, the PHP startup order, or other configuration options.

🎯 Final Words

Once you have applied the primary fix method (configuring Xdebug in php.ini), restart your UniServer service to apply the new configuration. If you are still experiencing issues, try the alternative fix method of checking your UniServer setup for any potential configuration errors. With these steps, you should be able to resolve the issue and start seeing error messages in your PHP code.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions