All the latest news, service updates and special offers
May 2012

How to Fix “Warning: ini_set() has been disabled for security reasons” Error

If you have ever had this pesky error appear in your WordPress installation, fear not as there are a couple of solutions.

[cc lang='text' line_numbers='false']Warning: ini_set() has been disabled for security reasons in /home/domain/public_html/links/settings.php on line 116[/cc]

The reason you receive this error is because…..wait for it…..the ini_set() function is disabled in your server. It is a PHP setting that your hosting provider (usual the low-cost ones) has disabled, more than likely because they think it will enhance security. You must enable it in your php.ini file or contact your hosting provider. Unfortunately, your hosting provider probably not permit this, particularly if you are hosted on a shared server and so you are left with one of the following solutions.

Option #1

If you don’t have one, create a php.ini file. To do this, simply open Notepad and paste the following line:

[cc lang='php' line_numbers='false']disable_functions =[/cc]

Save as php.ini and then upload to both your public_html directory and wp-admin folder. You might also like to edit the permissions on the file to 640.

Option #2

The error will contain the precise path, file and line where the error occurs.

If you are using WordPress, from your admin panel, navigate to Appearance > Editor and select the offending file. The WordPress file editor does not display line numbers and so you should either copy and past the content of the editor window into your preferred code editing software where lines will be displayed, or you should download the offending file and open with said software.

Navigate to the offending line and place // (double forward slash) in front of it.

[cc lang='php' ]Warning: ini_set() has been disabled for security reasons in /home/domain/public_html/links/settings.php on line 116[/cc]

Save and upload or copy and past back to the WordPress editor and then save.

I sincerely hope that this helps but if all else fails, move to another hosting provider. Why not take a look at what Bendigo Web Design has to offer?


Tagged with: , ,

amazing …. i have solved my problem. :)

Leave a Reply