Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com Jul 2 '10 at 16:32

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

1  
@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
add comment

1 Answer

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 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.

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
add comment

Your Answer

 
discard

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.