PHP Ini Set Error: How to Fix "Warning: ini_set() has been disabled for security reasons" Error
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 occurring. 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.
More Articles by Beth Parker:
- Writing Money
I have gotten to the point where I am making a decent amount of money writing online, and as a result, I get questions from friends and family members about how they too can earn some money writing online. ... - Summer Camp
Summer camps for girls provide a great way for girls to try new things in a safe environment. With proper supervision by counselors, girls can learn a variety of activities such as horseback riding,... - Protein Shakes
Protein shakes are delicious, creamy, smooth and can be made with just about any type of fruit or vegetable. They are the perfect way to replace a meal whether you are in a hurry or trying to lose weight. ... - Spy Camera Gadgets
Did you ever want to be a spy when you were a kid? Well, there are all kinds of high-tech gadgets you can buy if you still want to play spy games. Of course, there are practical applications as well. ... - IceStone Recycled Glass Countertops
If you're thinking about remodeling your kitchen or bathroom and are concerned about the environmental impact of various building materials, IceStone is a green alternative that you might want to consider. In...