Php – Using separate php.ini files per vhost in Xampp

apache-2.2PHPphp.inivirtualhostxampp

My web host provides separate php.ini files per web root, which is quite useful as I host some websites which require different PHP settings.

But on my dev system where I use Xampp, I can only find a single global php.ini file, which makes altering the settings per vhost quite difficult. Does anyone know if it's possible to alter the Xampp setup (or Apache / PHP?) to allow separate php.ini files per vhost? Thanks

Best Answer

There doesn't appear to be a direct XAMPP option for this. Have the tried changing the .htaccess file in the root of each vhost on your machine? From askapache.com:

in root .htaccess
SetEnv PHPRC /location/todir/containing/phpinifile

They also have some other suggestions to redirecting to a custom php.ini file.