How To Disable PHP Register Globals -- Drupal Status Report
Ranked #3,259 in Computers & Electronics, #64,843 overall
Trying To Figure Out How To Get Rid Of That Annoying Warning From The Drupal Status Report?
So I'm comparing Drupal and Joomla on my test site. I want to learn both Content Management Systems (CMS), then decide which, if either, I'm going to use for my websites.
I'm not much for sitting down and reading page after page of documentation before digging into a system. It doesn't matter if it's hardware, or software, I'll only look at the documentation after I run into a problem.
Unfortunately, the problem with register globals is not actually something you can correct from within Drupal itself. If you need to disable register globals, you need to do it with your domain hosting files, or have your hosting company disable it for you.
Before contacting my hosting company, I decided to try to disable it myself, and here's how it turned out.
(Druplicon from Druplicon | drupal.org)
Welcome To Your New Drupal Website
One Or More Problems Were Detected With Your Drupal Installation

I had set up a subdomain to serve as my test site, and installed the current version of Drupal available from my hosting company.
Here was the first thing I noticed when I went to the admin screen after installing Drupal for the first time.
Status Report

Looking over the Status Report, I notice two problems. The first one has to do with updates, and this sounds familiar to me. Whenever I start up a new computer, the Operating System usually needs to be updated.
The second problem is with PHP register globals, which is a new term for me that I know nothing about.
I decide to tackle the easier looking problem first, and see if the problem with PHP register globals is also taken care of.
The recommendation is to run "cron" or check manually. I wasn't familiar with cron, but a little research told me that it is a Linux term. Cron is a program that can be scheduled to automatically run commands and scripts.
In this case, I need cron to look for available updates for my Drupal install.
There is a security update available for your version of Drupal

After running cron, I discover that there are some updates available,
"There is a security update available for your version of Drupal. To insure the security of your server, you should update immediately! See the available updates page for more information."
The problem with PHP register globals also indicates a security risk, so I'm more hopeful that installing the updates will take care of both problems.
Available Updates - Drupal Core
Security update required!

As far as I can see, the updates need to be installed manually by me, so I download the zipped files to my own computer. I make a new directory in my Drupal install using the file manager with my hosting company's cPanel -- cPanel is another Linux term, it is basically a way for me to access the files of my hosted website with a browser on my own computer.
I unpack the zip file, and I'm ready to go.
Drupal: Site Off-Line
Oh no! I locked myself out!
Even though my site isn't likely to be getting any visitors, I decided to set it to maintenance mode before installing the updates.
I logged out, then tried to get back into my site, and faced a screen with no obvious way to log back in.
Luckily, the solution is to just manually add "user" to the address in the address bar, this brings me to a login screen.
Updating Drupal

Upgrading is as easy as backing up your existing files, so you can delete the ones in your main directory, and replace them with the files from the zip archive.
The .htaccess file may need to be copied from your backup, you'll also need sites/default/settings.php, the 'files' directory, any subdomain folders, or any other custom files like cron scripts in scripts/ or customized themes within sites/all/themes/custom/.
Since my site is new, I didn't have many of these files to copy over. You really should read Upgrading from previous versions before attempting an upgrade.
Database Updates - Out Of Date
PHP register globals still enabled

"Some modules have database schema updates to install. You should run the database update script immediately."
I wasn't exactly sure what this meant, but I could see that my PHP register globals still hadn't been taken care of and now I have two red warnings!
I followed the advisory from the Database Updates line first
Drupal Database Update

Running the database update appeared to make sure the information I had copied over from my old site were compatible with the updates I had just installed.
Drupal Core Update Status

After the database update, I was back to one yellow exclamation point and one red warning.
The Drupal core update status line was now an issue, and the PHP register globals problem still wasn't corrected.
Time to run cron again
Cron Ran Successfully
Drupal core update status - Up to date

I ran cron again, which verified that there were no more updates needed.
I was finally down to just one issue, but it was this persistent PHP register globals issue. None of the other problems appear to have been related to it.
Now I start looking at the actually recommendation in the warning. I follow the link to the PHP manual, and learn enough to see that PHP register globals is set outside of Drupal.
One of the first areas I'm directed to is the .htaccess file, a file I know a little about. It is a configuration file that is located in the root of your web directory. It is often used for Authorization/Authentication, Cache Control, Customized Error Responses (like "HTTP 404 Not Found") and Rewriting URLs.
(For more information about .htaccess look at: .htaccess Tutorial)
Looking At .htaccess
PHP 4 & PHP 5

I looked at the .htaccess file in the directory for the subdomain I had installed Drupal in, and did find three references to PHP register globals.
It was set to "0" on all three lines, which should mean I was all set, or at least that's what I thought from what I had read so far.
Time to dig some more.
php.ini - The Missing File
Create New File

I did find reference to a configuration file other than .htaccess that appeared to be specifically for PHP, and I did not have one of those.
That file is "php.ini" and since it was missing from my directory, I decided to make it.
Note: If you are using PHP 5 with an account hosted on GoDaddy, you may need to name this file "php5.ini"!
register_globals = Off

Based on a post on the Drupal support forums, register_globals is enabled, I wrote this very simple file, and tried it out.
Drupal Is Now Ready To Go!
Status Report - All Green Check Marks!

This looks like what I want. No more exclamation marks or red warnings!
I'm actually glad this happened, since it exposed me to how my installations interact with my web host's settings. It also prepared me for the future when, if I continue to use Drupal, I may need to update a live site.
Of course, I'll test any changes I make on a duplicate test site before actually working on a live site.
This worked for the hosting company that I use, but I can't say for sure what other companies it will work with. Considering how easy it turned out to be, I'm glad I tried it before bothering tech support about it,
I did glean some some information from my hosting company's support forums, and may have actually found the solution there, if I had spent more time sifting through the information. Otherwise, I would have posted in the forums asking for help before calling support if this hadn't worked.
Now I'm ready to start building!
Drupal News from Dries Buytaert
Fetching RSS feed... please stand by- Support | drupal.org
- Get started
Get up and running building your site with Drupal: Start here
Get Documentation
Find answers to your questions in the handbooks
Get Help
Help, meet, chat, discuss, and learn even more in the forums
Comments? Let Me Know What You Think!
-
Reply
-
Karen
Oct 5, 2011 @ 6:02 pm | delete
- CleanerLife, Thanks so much for your help on the Register Globals problem in Drupal! <3
-
-
Reply
-
edzsquid
Aug 4, 2011 @ 4:30 am | delete
- Wow, Nice lens! I found it great info! Thanks!
-
-
Reply
-
yeoj
Sep 29, 2010 @ 1:15 am | delete
- thanks this help me a lot
-
-
Reply
-
spirituality
Feb 21, 2010 @ 7:46 am | delete
- Great lens, blessed by a squidangel :)
-
-
Reply
-
squidoohelp
Feb 21, 2010 @ 7:35 am | delete
- Wow- brave! trying out both Joomla & Drupal. Joomla is already a learning curve, but Drupal sounds even worse. I'm sticking to WordPress :) But great lens.
-
-
Reply
-
Rusty
Jan 26, 2010 @ 6:53 am | delete
- DUDE! I cant believe it, i looked everywhere for something to help me, read through your frustration and made the php.ini, and BAM, it worked straight up. I want to thankyou very much for posting this, excellent information and a very clear description, aswell as the workings instead of just the answer. Well done mate, and thanks again!
-
-
Reply
-
gammydodger
Nov 8, 2009 @ 12:02 am | delete
- thank you, would have been completely lost without this help
-
-
Reply
-
ijaz
Jul 31, 2009 @ 2:51 am | delete
- excellent piece , easy, simple, direct. thanks.
-
-
Reply
-
Sean Davis
Jul 30, 2009 @ 6:59 am | delete
- I spent an hour surfing the net like "Why doesn't someone just say what the **** to do?" Then I come here and all you tell me is what the **** to do. I did it and now I'm good to go. You are ****ing awesome. Thank you.
-
-
Reply
-
badmsm
Jul 23, 2009 @ 10:00 pm | delete
- Thanks, CL! Sure this will save me loads of time & frustration. :)
5 starts & a Squid Angel Blessing!
-
-
Reply
-
CCGAL Jul 19, 2009 @ 9:38 pm | delete
- If I ever decide to use Drupal, I know I will be coming to your lenses to see what you've documented. I don't understand much of this, but I think if I had my cPanel open and was working on a Drupal site, this would give me the step-by-step instructions I need. Your explanation of what you did, coupled with the screen shots and the reasoning behind your choices was exceptionally clear and easy to follow, even for a non-drupal user like me.
Excellent work! 5*
-
-
Reply
-
Sojourn
Jun 3, 2009 @ 8:14 pm | delete
- Very helpful as I continue to dig in to PHP. I enjoy reading how others solve their tech problems because I think you learn even more that way than by someone who walks you through as if it was a piece of cake. It's never a piece of cake. Nice how-to lens!
-
-
Reply
-
GrowWear
Jun 1, 2009 @ 3:11 am | delete
- Certainly will look here for directions if I ever need to do this! Wonderful job.
-
-
Reply
-
0ctavias0fferings
May 28, 2009 @ 3:43 pm | delete
- Wow, thorough walk through. fantastic for anyone who needs to find the solution 5*
-
-
Reply
-
JGeezy
Sep 23, 2010 @ 1:33 am | delete
- Dude. You are my F@#$*()ing HERO! I've been trying to get this fixed for 6 months!
-
Enjoy This Lens On How To Disable PHP Register Globals?
This module only appears with actual data when viewed on a live lens. The favorite and lensroll options will appear on a live lens if the viewer is a member of Squidoo and logged in.
About CleanerLife
Freelance Web Developer and content provider.
Lensmaster with over 100 pages of content on Squidoo.
Webmaster for Careers Resources, Live Success and All This and More.
I'm addicted to the Internet, I'm also an information and entertainment junkie.
I'm obsessed with eating healthy, fresh food raised or grown as local as possible, reducing pollution, increasing recycling, and using natural products in and around the home.
CleanerLife On Twitter

- CleanerLife
- aka Dan B
- 1,644 followers
- 1,684 following
-
- Busted! Scientists leave out data to produce bogus findings http://t.co/8qqxahhE via @HealthRanger
-
- The top 10 most censored Natural News stories of 2011 http://t.co/osUjiUMZ via @HealthRanger
-
- Artificial Sweetener Disease; a new breed of sickness http://t.co/esXMNi9K via @HealthRanger
-
- How Antibiotics Make You Fat | Mark's Daily Apple http://t.co/yJltPxfd
-
- 'Green' debacle: Tens of thousands of abandoned wind turbines now litter American landscape http://t.co/quJf2MM8 via @HealthRanger
CleanerLife's Top 10
Fetching RSS feed... please stand by
Drupal is a registered trademark of Dries Buytaert.
Original content:

How To Disable PHP Register Globals
by CleanerLife
is licensed under a Creative Commons
Attribution-Noncommercial-No Derivative Works 3.0
United States License.
by CleanerLife
Lensmaster, Webmaster, I'm addicted to the Internet. I'm an information and entertainment junkie.
I'm obsessed with eating healthy, fresh food raised...
more »
- 93 featured lenses
- Winner of 12 trophies!
- Top lens » How To: Easy To Install Wireless Backup Camera
Explore related pages
- Tips And Ideas For Designing A Successful Website Tips And Ideas For Designing A Successful Website
- Why I Love The GIMP For Photo Editing Why I Love The GIMP For Photo Editing
- How To Remove Backgrounds From Images & Pictures How To Remove Backgrounds From Images & Pictures
- ★ How to Sell Your Handmade Products Online! | ETSY SUCCESS TIPS & TOOLS ★ ★ How to Sell Your Handmade Products Online! | ETSY SUCCESS TIPS & TOOLS ★
- How To: Easy To Install Wireless Backup Camera How To: Easy To Install Wireless Backup Camera
- How To Grow Your Own Supply Of Broccoli Sprouts In 6 Days How To Grow Your Own Supply Of Broccoli Sprouts In 6 Days


