Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.