How to locate php.ini in XAMPP

Find the php.ini configuration file in XAMPP on Windows using the XAMPP Control Panel or by navigating to the PHP directory.

Find the PHP configuration file ( php.ini) in XAMPP on Windows to modify settings such as upload limits, memory allocation, error reporting, and extension loading.

Prerequisites

Step-by-Step: Locate php.ini in XAMPP

Option 1: Open php.ini from the XAMPP Control Panel

  1. Open the XAMPP Control Panel. Click the Configbutton in the Apache row.

  2. Select PHP (php.ini)from the dropdown menu. The XAMPP Control Panel opens the php.ini file in the default text editor.

    XAMPP php.ini file location in control panel

Option 2: Navigate to the php.ini File in the File System

  1. Open the XAMPP installation directory. The default path on Windows is C:\xampp.

  2. Open the php folder. The php.ini file is located at C:\xampp\php\php.ini.

Option 3: Find the php.ini Path Using phpinfo()

  1. Create a file named phpinfo.php in the XAMPP htdocs directory with the following content:

    <?php phpinfo(); ?>
  2. Open http://localhost/phpinfo.php in a web browser. The phpinfo() output page displays a row labeled Loaded Configuration File. The value shows the full path to the active php.ini file that PHP is using.

How to Verify php.ini Changes in XAMPP

Edit the php.ini file and save the changes. Restart Apache HTTP Server from the XAMPP Control Panel. Open http://localhost/phpinfo.php in a web browser. The phpinfo() output reflects the updated settings.

Common Issues When Editing php.ini in XAMPP

Changes do not take effect.Apache HTTP Server must be restarted after editing php.ini. Click Stopand then Startnext to Apache in the XAMPP Control Panel.

Editing the wrong php.ini file.XAMPP may contain multiple php.ini files. Use the phpinfo() method to confirm which file PHP loads at runtime. The Loaded Configuration Filerow shows the active file path.