How to locate the php.ini file (xampp)

The location of the php.ini file depends on how you installed XAMPP.

If you installed XAMPP using the installer, you can find the php.ini file at C:\xampp\php\php.ini.

If you installed XAMPP using the ZIP file, you can find the php.ini file at C:\xampp\php\php.ini.

If you are using a Mac or Linux, the php.ini file can be found at /Applications/XAMPP/etc/php.ini or /opt/lampp/etc/php.ini, respectively.

Watch a course Learn object oriented PHP

You can also locate the php.ini file by using the phpinfo() function in a PHP script. To do this, create a new PHP file in your web root directory (e.g. C:\xampp\htdocs or /Applications/XAMPP/htdocs) with the following code:

<?php
phpinfo();
?>

Then, open the PHP file in your web browser (e.g. http://localhost/info.php). The path to the php.ini file will be listed under the Loaded Configuration File section.