create your own

PHP Ini Set Error: How to Fix "Warning: ini_set() has been disabled for security reasons" Error

73
rate or flag this page

By bethparker


The Problem

I recently installed Drupal on my new website. I used the Fantastico installer on my cPanel so it should have been easy, right? Imagine my surprise when I loaded the front page of my website and saw a whole page of error messages!

After much research, I was able to get the problem fixed... well, patched at least. I am not a master programmer by any stretch of the imagination, so don't get mad at me if this doesn't work for you. It worked for me, and I am passing it on in case it can help someone else.

From the information I found during my research, it appears that these errors are caused by a security setting on the web host's site. Since I can't change their settings, the solution was to comment out the lines that caused error messages. This article will explain how to do that.

The Solution

Before you get started, look at the error messages you are getting on your website. They will contain the path and file name of the file where the error is occuring. They also tell you which line of the file the error occurs in.

Now that you know which file is causing the problem, log into the control panel of your website and navigate to the offending file. You will need to open it for editing. If you have the option of opening in a code editor, choose that option.

Now scroll down to the offending line or lines. In my case, there were several lines all together that were causing errors. To comment out a large group of lines, you can do the following:

1) Add /** in the line before the error. This needs to be in a line all by itself, so if there is something in the line above, add a blank line and then type /** in it.

2) Add * before each line that is causing an error message.

3) Add */ in a blank line following the offending lines.

All Done!

 

Look at the picture above to see how the commented lines should look.

If you have a single line by itself that is causing an error, you can comment that line by itself by adding // at the beginning of the line.

After commenting out the group of errors shown in the settings.php file, I still had about half a dozen error messages. I next commented out the single line that was causing an error in bootstrap.inc (line 342). After that, the rest of the error messages went away.

Now, I can't promise that commenting these lines out won't cause problems down the road, but if it does, I'll try to post an article telling you how to fix those too.

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

Mandy  says:
14 months ago

Oh my if i could kiss you i would. I have 5 different domains on the same hosting company. They changed their security protocol and i had the same ini_set error on all pages. I've been searching for a fix any kinda of fix for weeks now, and i stumbled onto this page, and your little trick worked, and worked perfectly. Again thank you!!

Hugs

Mandy

Submit a Comment

Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working