My development environment is shared with other developers of my startup and is setup on Rackspace. The php.ini file is located in /etc/
folder, and I believe this is a centralized location from where every other developer's dev environment setting is being configured from. I want to customize this php.ini
file specifically for myself rather than having to do it in the /etc
/ location.
Specifically I am setting up XDEBUG in my environment, some other developers don't want it, so I don't want to bug em :)
To do so, I scanned the Internet on how to override the php.ini file specifically for a directory, and found this page on stackoverflow
And following that, I simply copy pasted the php.ini file within my htdocs folder and then simply echoed out phpinfo()
(I echoed this in one of my Controllers, (using Zend)). The index.php file is within the htdocs folder.
When I look @ "Loaded Configuration File", it still reads
/etc/
instead of ../htdocs/
Anybody know what's up?
I'm not sure you understood the post. The post means if you run the server and want a per domain php.ini you can run the module as a per domain so each user controls there domain php.ini however it looks like your server does not offer this so you will need to us htaccess file to overwrite the php.ini settings.
By over write this doesn't mean you can change the directory this means maybe add a module or add error reporting ect...
You can do it by using this post: How can I use xdebug to debug only one virtual host?
In general, it isn't possible to load
php.ini
on a per directory basis, but in some special cases (CGI/FastCGI), it is: see documentation for Per-user configurationIf you are hosting several independent sites on one server, you should consider FastCGI anyway, to keep them separated. With
php5-fpm
it's very easy to setup many pools of workers.Note that only set a limited subset of the ini-options in the user-ini-file. As you said you don't have control on the server, the possible work-arounds would be to:
ini_set()
to override the changes inside your script. Not all of the configuration directives can be changed usingini_set()
though.php.ini
file.(certain parts adapted from #1438393)
Hope this helps!