2

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

Spoonface
  • 207
  • 3
  • 8
  • 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 02 '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 02 '10 at 18:15

1 Answers1

2

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.

Jack B Nimble
  • 1,505
  • 1
  • 10
  • 13
  • 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 05 '10 at 19:59