dlebowski Posted August 11, 2008 Share Posted August 11, 2008 I was wondering how many php.ini files should I have on my server (dedicated) and where should I put them. When I run php info it tells me there is one in /usr/lib. If I look on my server, i have about 12 more in other directories. Any help would be appreciated. Thanks. Ryan Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/ Share on other sites More sharing options...
trq Posted August 12, 2008 Share Posted August 12, 2008 PHP generally only reads ini files from two locations. The configuration file path (generally /etc/php5 or similar) is where you main php.ini file should reside. Then there is also an additional file path (generally /etc/php5/conf.d or similar) where you can place individual ini file (eg; mysql.ini) containing options for specific extensions. Any other ini files outside of these paths will not generally be read. However there is the PHPINIDir option available from within your httpd.conf file or even .htaccess which will allow you to specify a php.ini on a per site/virtual-host bases. Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614404 Share on other sites More sharing options...
dlebowski Posted August 12, 2008 Author Share Posted August 12, 2008 Thanks for the clarification. When i run phpinfo(), it tells me that my php.ini file is in /usr/lib. I am assuming this is where the file was put when php was installed on my server. If this is where phpinfo() shows my file, is it safe to assume this is the one it's reading? If so, I will remove the others. Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614506 Share on other sites More sharing options...
trq Posted August 12, 2008 Share Posted August 12, 2008 If this is where phpinfo() shows my file, is it safe to assume this is the one it's reading? Yes, but whoever installed php is a bafoon. The /etc directory is generally reserved for configuration files, hence it is also usually protected against its contents being overiden when applications are installed / upgraded. /usr offers no such protection. Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614607 Share on other sites More sharing options...
dlebowski Posted August 12, 2008 Author Share Posted August 12, 2008 Is there any way that I can "safely" move this file as well as update my php installation to know where the new file resides? Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614620 Share on other sites More sharing options...
trq Posted August 12, 2008 Share Posted August 12, 2008 You would need to reinstall php completely. What distro are you using? Was php installed from source? Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614628 Share on other sites More sharing options...
dlebowski Posted August 12, 2008 Author Share Posted August 12, 2008 CentOS and I'm not sure how php was installed. The people that host my server took care of it for me and that was over a year ago. Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614638 Share on other sites More sharing options...
trq Posted August 12, 2008 Share Posted August 12, 2008 I would say it was built from source as a binary package such as those provided by yum wouldn't (at least shouldn't) be misconfigured. Quote Link to comment https://forums.phpfreaks.com/topic/119208-solved-location-and-number-of-phpini-files/#findComment-614666 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.