Warning: ini_set() has been disabled for security reasons

You might see this error "Warning: ini_set() has been disabled for security reasons" when you install a fresh copy of CMS [Joomla/ Wordpress /Drupal].You don't need to panic by seeing this error actually your Website-Hosting-server might have disabled the PHP Function ini_set() .You can solve the issue by taking to your Web host [or] by following the steps mentioned below.

Steps to solve error:-

  1. Open your Cpanel
  2. Open your website folder
  3. Create a new file named as " php.ini"
  4. Type "disable_functions = " in the php.ini file & save the file
  5. Now load your website error should be resolved
  6. That's it

The above steps should solve the problem on the front-end.In some case if you tried to login to backend of your website using joomla administrator login credentials it will not allow you to sign into admin account and it keeps giving the above error in backend.

To resolve "Warning: ini_set() has been disabled for security reasons" in the joomla administration


  1. Log into your cpanel
  2. Edit the configuration.php file in the website root directory .[Public-html/websitename/configuration.php]
  3. In between lines <?php and class JConfig add the below code
    @ini_set(‘display_errors’, 0);
  4. The code should look like this
    @ini_set(‘display_errors’, 0);
    class JConfig {
  5. save the file
  6. Reload the joomla backend . Now you can signin with admin login details

Note:- Evem after following the above steps on some websites error keeps on showing it will not allow you to make changes in the administrator.To rectify this issue you need to edit session.php file.

  1. Goto [Joomla-website-root-folder]/libraries/joomla/session/session.php
  2. Edit the session.php file
  3. Search for ini_set in the file
  4. Add "@" before every ini_set line
  5. i.e "@ini_set"
  6. save the file
  7. That's it