akaris Posted June 8, 2007 Share Posted June 8, 2007 Hi! Recently I changed of hosting company. I used to use .htaccess to change my PHP settings, but my new hosting company forbids that. Instead, they told me to use php.ini files. So I had to put a php.ini file in every directory of my website where I wanted special settings. Example: ~/public_html/admin/admin.php ~/public_html/admin/index.php ~/public_html/admin/php.ini ~/public_html/index.php ~/public_html/php.ini php.ini is being read in every directory and the settings it contains are applied to that directory only (not recursive like .htaccess). Anyway, it works well. My problem is: I try to reproduce that behavior at home, on my Windows 2003 server (Apache 2.0.55, PHP 5.2.2), and I really didn't found any clue anywhere about how to setup that! Is it in Apache, is it in php.ini, I just don't know. Help! - Mike Quote Link to comment https://forums.phpfreaks.com/topic/54816-how-to-get-phpini-to-be-read-in-every-directory/ Share on other sites More sharing options...
s0c0 Posted June 9, 2007 Share Posted June 9, 2007 Wow that sucks. See if you can create a symbolic link (for linux) in windows umm im not sure what it would be, i guess like a shortcut to the php.ini in every directory. The idea is to have one php.ini in your www root, and then have "links" to it everywhere else. In linux it would be something like: ln -s php.ini /directory/where/its/stored/in or the otherway around, just google the ln shell command. Quote Link to comment https://forums.phpfreaks.com/topic/54816-how-to-get-phpini-to-be-read-in-every-directory/#findComment-271233 Share on other sites More sharing options...
akaris Posted June 9, 2007 Author Share Posted June 9, 2007 Hmm I think that you misunderstood my problem. My problem is not to put my php.ini files in directories... my problem is "how to configure php and/or apache to get it actually READING php.ini in every directory at runtime". (p.s.: the syntax for `ln` is `ln [-s] <source> <destination>`) - Mike Quote Link to comment https://forums.phpfreaks.com/topic/54816-how-to-get-phpini-to-be-read-in-every-directory/#findComment-271421 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.