Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6736873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:10:54+00:00 2026-05-26T11:10:54+00:00

How to make sure the user cannot override the setting using .htaccess or custom

  • 0

How to make sure the user cannot override the setting using .htaccess or custom php.ini
any tips for configuration i should use

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:10:54+00:00Added an answer on May 26, 2026 at 11:10 am

    To prevent users setting PHP config values in .htaccess files, do not give AllowOverride Options permissions 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:

    ; Directives following the section heading [PATH=/www/mysite] only
    ; apply to PHP files in the /www/mysite directory.  Directives
    ; following the section heading [HOST=www.example.com] only apply to
    ; PHP files served from www.example.com.  Directives set in these
    ; special sections cannot be overridden by user-defined INI files or
    ; at runtime. Currently, [PATH=] and [HOST=] sections only work under
    ; CGI/FastCGI.
    ; http://php.net/ini.sections
    

    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:

    ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
    ;user_ini.filename = ".user.ini"
    ; To disable this feature set this option to empty value
    ;user_ini.filename =
    

    So just uncomment that last line to disable per-user ini files. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make sure that user can run only one instance of my
I have a user model on which I check to make sure that the
I want to make sure people can't type the name of a PHP script
I'm using force_ssl (Rails 3.1, specifically in the Devise config) to make sure that
how can I make sure that Apache/web server user is allowed to execute shell
How can I make sure that some code, that is executed in a php
I cannot find a way to make sure the function is complete before checking
one of the validations I want is to make sure that the user does
To make sure that the text in listbox items is not truncated I want
I want to make sure that a set of functions have the same signature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.