How to make sure the user cannot override the setting using .htaccess or custom php.ini
any tips for configuration i should use
How to make sure the user cannot override the setting using .htaccess or custom
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To prevent users setting PHP config values in .htaccess files, do not give
AllowOverride Optionspermissions on their virtual hosts.Alternatively, install PHP as CGI instead of as an Apache module, as the CGI version is unaffected by .htaccess files. However, since PHP 5.3.0, PHP CGI does parse per-directory php.ini files. I am not aware of a method that turns this off.
EDIT: I’ve just seen this in the latest default php.ini:
So if you put directives in your main php.ini under per-directory headings they cannot be overridden. However, the downside is that you’ll have to do this for every virtual host so it’ll be a PITA in environments where there are many or where new ones are frequently added.
EDIT AGAIN:
Further reading has revealed this:
So just uncomment that last line to disable per-user ini files. 🙂