server options - Post ID 20135

User 150829 Photo

Registered User
2 posts

i have to make changes to the php in the server :

Off PHP Safe Mode

Off PHP Safe Mode GID

Off PHP Register Globals

please help me out what to set for on and what to set for off
i hate things i don't understand ;-)
User 4539 Photo

Registered User
540 posts

Hi, Danny.

I'm assuming you're trying to change the PHP settings on your PC. If it's the settings on your web hosting service you need to change, you'll probably have to contact your hosting service.

I use a Windows PC with PHP 5.05 installed (running on an IIS server). In my machine, I can go to the c:windows directory and find the "php.ini" file.

You can open the "php.ini" file with Notepad or similar text editor. Once it's open, you can search ("CTRL-F" in Notepad) for "Safe Mode" (without the quotation marks). It'll take you to the first instance of "Safe Mode." Scroll down a few lines and, you'll find:

; Safe Mode
safe_mode = Off

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = Off

(You probably won't find the asterisks, I just put them in here.)

You can change the "Off" to "On" in the two places above.

Then do a search (CTRL-F in Notepad) for "register_globals" (don't foget the underscore between 'register' and 'globals').

You'll find:

; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off

You can change the "Off" to "On" here.

After you've made these changes, be sure to save the file.

Next time you run PHP on your machine, the effects should be in place. However, if your web hosting service doesn't have these switches turned on, your script may not work correctly on the web.

I hope this helps.
Mostly just lurking these days ...

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.