Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from Jul 2 '10 at 16:32

This question came from our site for professional and enthusiast programmers.

@ani Saying this is not a programming question is like saying a question about working with visual studio is not a programming question. He's not trying to set up a server, he's setting up his programming environment. Should not have been migrated. – Artefacto Jul 2 '10 at 16:47
@Artefacto: This has to do with setting up the environment, it has nothing to do with actual programming. Note: Deleted previous comment because link was spelled wrong. – animuson Jul 2 '10 at 18:15
up vote 2 down vote accepted

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

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

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

share|improve this answer
This will generally not work; during internal requests Apache prepends REDIRECT_ to the environment variable name if SetEnv is used in a directory block or in .htaccess. – Artefacto Jul 5 '10 at 19:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.