register globals off

They have: 426 posts

Joined: Feb 2005

I'm trying to install joomla on my server, however it requires register globals to be off. My server provider have it on by default. They have advised me to create a php.ini file with the following line in it:

PHPSuExec Servers: register_globals Off '

As you can see like they mentioned they have something called phpsuexec installed on the shared servers.

Well my problem is this. I created a php.ini file, i only put that one line inside of it and uploaded it to my root directory.

It has not solved the problem. Also, it is running on a subdomain, do you think it is causing a problem or should a php.ini file change permissions for the directory it is in??

They have: 43 posts

Joined: Mar 2007

You should create an .htaccess file not a php.ini. Put this file in your root directory. If you already have an .htaccess file just add this to it

php_flag register_globals off
Order allow,deny
Allow from all

The Best User Driven Poker Site, where you can find Poker Games in your area and get the latest Poker Strategy.

They have: 426 posts

Joined: Feb 2005

Yes i tried that and that rule throws up an error 500? I think thats why they advised me to add a php.ini file instead with this line:

PHPSuExec Servers: register_globals Off
'

However is there anything else i need to put in this file in order for it to work? Do you think it would go in the root or the subdomain directory?

Im actually confused as to why there is a php.ini and a .htaccess if they can both do the same thing?

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

The htaccess file will not work as their PHP is probably compiled as a CGI Module. Create a php.ini file for every directory you need register globals changed, and add this line:

register_globals = Off

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

.htaccess files are for setting parameters for Apache. Php.ini files are for setting options for PHP.

Some servers do let you set php parameters in the .htaccess files if php is compiled as an Apache module. I think your is not in this case.

You will have to put this php.ini file in every directory you want it to take effect.

Can you post the error from your error log? Also, what version of PHP are you using?

They have: 426 posts

Joined: Feb 2005

Yes, i thought that i might have to add it to all directories. Im trying to install joomla, and it requires register globals to be off.

So when i created the php.ini file, i put it in the root (well subdomain root) it still gave me a message that register globals was off? So this obviously means a that i need to put one of these files in every directory of the joomla installation!!?

What an arse!

There must be an easier way?

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

If there was an easier way, I would have said it.

Test the feature to make sure your host even supports it first. You need PHP 5.2. Place a php.ini file in the same directory as a script with phpinfo() to see if it changes the settings.

Once that's done, you only need to copy it to the directories with php scripts.

I had to do it for multiple OSCommerce installations, and I only needed it in a few directories.

They have: 426 posts

Joined: Feb 2005

Well i have php 4 installed? My host keeps replying saying that i need to put a php.ini file inside the directory. It is running php as a cgi which is why a .htaccess wont work and throws up a error 500.

So if i create a phpinfo() file and then put a php.ini file inside that directory it should say that register globals is off??

Correct it worked. phpinfo says register globals is off. So i have to put this php.ini in every directory with php files. This includes directories within directories?

Thanks for the help.

Update: yes it worked. I put it in only a few directories perhaps taking into account that some files are includes and so on. Maybe itr will be ok. Anyway installation is ok with it so what the hell!?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.