Php – How to change the default xampp php.ini directory

PHPxampp

The php.ini file in xampp is located here: C:\Windows for php.ini

The phpinfo contains this information:

Configuration File (php.ini) Path C:\WINDOWS

Loaded Configuration File (none)

Scan this dir for additional .ini files (none)

How can i change the directory?

Best Answer

From my experience using XAMPP, it's better to put the php.ini file where XAMPP expects it to be by default. Typically XAMPP is going to look under its own dir. For Windows, it would look like, or similar to, this: [yourdrive_letter]:\xampp\php\php.ini . That's what should be showing up in your Loaded Configuration File setting. I always ignore whatever it says in Configuration File (php.ini) Path, because that's not really the ini that xampp is using. Go look under your xampp directory and find the "php" folder. If it's not there, then it needs to be (unless you've somehow configured xampp to look elsewhere). So find the PHP folder you want to use and put it under the xampp folder. The version of xampp I have does not allow for switching php versions/folders "on the fly", so the folder MUST BE named "php". (Yeah, I've tried having two php folders with different names and just swapping them out -- that doesn't work well in xampp).