.htaccess directive to read single php.ini as it exist in every folder ?

Hi,

I would like to request an assistant.

May i know how to create a .htaccess directive, so that if i placed the php.ini file in /home/user/public_html/php.ini , all file the PHP file will use php.ini configuration from the mentioned php.ini file recursivedly for all folders in public_html .

This is to avoid having many php.ini in every folder inside public_html .

Hope anybody can help me in this issue.

Thank you.

LVL 2
Shamsul KamalJunior TechAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

karoldvlCommented:
0
Shamsul KamalJunior TechAuthor Commented:
Hi,

I'm sorry, the reason i would like to do this is due to Apache is run in DSO and not in suphp.

Changing this is not possible as there are many old hosting account inside the used with DSO configuration.

Appreciates of any assistant.
0
karoldvlCommented:
I'm afraid with mod_php you have to stick with php_value directive.
0
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

Shamsul KamalJunior TechAuthor Commented:
Hi,

If i convert to SUPHP, may i know how to avoid making copies of php.ini on every folder but use only single php.ini in /home/user/public_html/ folder ?

I intent to use .htaccess directive ,  but not sure the directive to put inside it.

0
karoldvlCommented:
What kind of settings do you want to change? Maybe going with individual .ini files is not the way to go? Especially, if you're talking about shared environment.
0
Shamsul KamalJunior TechAuthor Commented:
Hi,

No, because now i'm using suphp environment, every time my client would like to change php.ini setting, he need to put the customized php.ini in every folder in his web directory that having php files .

So i would like to avoid this by creating .htaccess directive that will helps to only place one php.ini in public_html folder and all his php file eventhough in other directory will reads php configuration from the public_html/php.ini file .

0
karoldvlCommented:
But why can't your client just use php_value directive in his root .htaccess? Isn't giving him full access to php.ini too much?

See here:
http://php.net/manual/en/configuration.changes.php
0
Shamsul KamalJunior TechAuthor Commented:
php_value directive  cannot be used in MOD_SUPHP ...

Client must used php.ini to customizes the php directive.
0
karoldvlCommented:
You said you don't run suPHP, but mod_php in the first place?
0
Shamsul KamalJunior TechAuthor Commented:
yeah...it was my mistake.

i was confused in my first response.
0
Shamsul KamalJunior TechAuthor Commented:
so the actual configuration, i'm using mod_suphp.
0
karoldvlCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.