How to locate the php.ini file (xampp)

How to locate the php.ini file (xampp)

  1. Blog
  2. 15 November 2026
  3. 2 min read

Stefan Bogdanescu

Founder & Senior Architect

Finding the php.ini File in XAMPP

Locating the php.ini configuration file on an XAMPP server is a common task when you need to tweak performance settings, adjust memory limits, or fix runtime errors. Unlike Linux-based servers where paths are often predictable based on the installation directory, XAMPP's structure can vary depending on how the package was installed and which operating system you are running.

On Windows, which is the primary platform for XAMPP, there isn't a single hardcoded path like /etc/php/8.1/apache2/php.ini found in Linux distributions. Instead, the location is determined by the php_ini_loaded_path directive within the PHP configuration itself. If you are unsure where the file lives, the most reliable method is to query PHP directly. You can create a simple PHP script with <?php echo ini_get('configuration_file'); ?>, place it in your project root, and access it via your browser. This command returns the exact path currently active for your Apache installation.

However, this only tells you where the active file is located. It does not guarantee that this is the only php.ini file on your system. XAMPP often includes multiple configuration files in the same directory structure to handle different SAPIs (Server Application Programming Interfaces). For instance, you might find a file named php.ini-development or php.ini-production. The active configuration is usually determined by an environment variable or a specific setting within the extra/ folder of your XAMPP installation. If you are developing locally, ensure you are editing the development version rather than accidentally modifying a production snapshot intended for deployment.

When you finally locate the file, typically found in the C:\xampp\php directory alongside php.ini-development and php.ini-production, you must exercise caution before making changes. The XAMPP installer often places a blank php.ini file to avoid conflicts with pre-existing settings. If you do not see any configuration options commented out, it is possible you are looking at a fresh default file. To verify if your changes take effect without restarting the entire Apache service immediately, you can append ini_set('display_errors', 1); to the top of your application's entry point or check the php.ini-development file directly if that is what your environment variable points to.

A critical pitfall involves the order of configuration files. If you have a custom .htaccess file in your project root, it might override settings defined in php.ini, though this depends on the specific directive. For example, memory limits (memory_limit) can sometimes be overridden via Apache's LimitRequestBody or other modules if not configured correctly. Always check the error log at C:\xampp\apache\logs\error.log after saving your changes. If you modify php.ini and restart Apache but see no change, verify that the file path in the phpinfo() output matches the one you edited. It is also worth noting that on newer XAMPP versions, the configuration might be managed through separate .dist files or included via php_options, so checking the contents of your specific installation version is essential before assuming standard paths apply universally.

Our network