Jump to content
  • Advertisement
Sign in to follow this  
theOcelot

[web] Set location of php.ini in httpd.conf

This topic is 3045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm ready to tear my hair out. I'm on Slackware 13, trying to set up a local Apache server for trying out different web technologies and configurations. I've got PHP running, but to avoid running as root all the time, I need to specify a php.ini file owned by my regular user. But I can't figure out how to tell Apache to tell PHP to look for php.ini in my personal site directory. If this is possible (and it seems crazy to think that it isn't), how do you do it?

Share this post


Link to post
Share on other sites
Advertisement
Of course now I find it... You have to set the PHPRC environment variable, where PHP looks for php.ini, in your httpd.conf using the SetEnv directive.
SetEnv PHPRC /path/to/config_file

Also, it seems running httpd ... -k restart doesn't clear all environment variables, so I had to completely stop it to see the effect.

Share this post


Link to post
Share on other sites
Thanks, that works too, and is clearer. [smile]

But even knowing what it's called, it's difficult to find clear documentation on it, and almost every time it's mentioned, it's in the context of a Windows installation. When you google just "phpinidir", the first thing to come up is a mostly incoherent thread on bytes.com. It would be easy to believe it was only for Windows.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!