Jump to content

[SOLVED] php.ini in every directory / how to make one in www for all sub-dirs?


sKunKbad

Recommended Posts

I've got a shared hosting account, and it turns out that each directory needs its own php.ini. If I was in full control, then I could make a symbolic link in each sub-dir, and that way when a main php.ini in the www root was changed the sub-dir php.inis would also. So, am I stuck putting a php.ini in each sub-dir? Is there a way to have a symbolic link in php that mimics the behavior of the normal linux symbolic link? What are my options, if any?

I found a solution that worked for me. I just put the following in my root .htaccess file:

 

SETENV PHPRC /HOME/PUBLIC_HTML/php.ini

 

I have a subdomain that is in a directory off of public_html, and it was showing errors after I did this, so I just put the same code in its directory, but changed the path so that it had its own php.ini, made the specific changes necessary, and all is well.

 

I guess this only works if you or your host is running php in CGI mode, which mine is. I did however find solutions that would have worked regardless of what way php is running.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.