473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

turn off register_globals on a shared server

Hello all,

My shared server provider has register_globals on. I checked by running
php_info(); from within a file. I would like to turn this off, but
asking them to turn it off just for me will not work.

I tried adding the following lines to the .htaccess file:
<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>
but that did not work. I thought that maybe the file is called
something else, and I could not find any file containing mod_php
anywhere on the server. Also, I can see that the addmodule line for
mod_php4.c is commented out in the httpd.conf file for the shared
server.

I do not know how the server can serve php if that line is commented
out?

Bottom line is: is the .htaccess approach the correct one? and does
anyone know how I can find out if I am using the correct filename?

phpinfo() says that I have PHP Version 4.3.11

I will leave phpinfo() running on the main page so that if someone
needs more information, they can find it at linux-place.com

Thanks,
Ahmed El-Daly
linux-place.com

Jul 27 '05 #1
12 3234
In article <11**********************@z14g2000cwz.googlegroups .com>,
ae*****@gmail.com wrote:
Hello all,

My shared server provider has register_globals on. I checked by running
php_info(); from within a file. I would like to turn this off, but
asking them to turn it off just for me will not work.

I tried adding the following lines to the .htaccess file:
<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>
but that did not work. I thought that maybe the file is called
something else, and I could not find any file containing mod_php
anywhere on the server. Also, I can see that the addmodule line for
mod_php4.c is commented out in the httpd.conf file for the shared
server.

I do not know how the server can serve php if that line is commented
out?

Bottom line is: is the .htaccess approach the correct one? and does
anyone know how I can find out if I am using the correct filename?

phpinfo() says that I have PHP Version 4.3.11

I will leave phpinfo() running on the main page so that if someone
needs more information, they can find it at linux-place.com

Thanks,
Ahmed El-Daly
linux-place.com


put the following in the .htaccess file in the root of your main page:

php_flag register_globals off
php_flag safe_mode on
Options -Indexes

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 27 '05 #2
Use the ini_set() function to change the values of the variables.

Thanks
Shabbir Bhimani

Jul 27 '05 #3
Rob
sh************@gmail.com wrote:
Use the ini_set() function to change the values of the variables.

Thanks
Shabbir Bhimani


alternatively you can upload your own php.ini to the root of your shared
web space.
PHP always checks for php.ini in the root of the document before it
checks elsewhere.

:)
Jul 27 '05 #4
ae*****@gmail.com wrote:
Hello all,

My shared server provider has register_globals on. I checked by running
php_info(); from within a file. I would like to turn this off, but
asking them to turn it off just for me will not work.

<snip>

<news:11**********************@l41g2000cwc.googleg roups.com> (
http://groups-beta.google.com/group/...24f27f2b7ac610
)

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com

Jul 27 '05 #5
Yes, this did the trick! Thanks!!

setting php_flag register_globals off in the .htaccess file caused a
500 error for some reason!

Thanks to all that replied.

Jul 27 '05 #6
ae*****@gmail.com wrote:
Yes, this did the trick! Thanks!!

setting php_flag register_globals off in the .htaccess file caused a
500 error for some reason!

Thanks to all that replied.


Possibly because PHP isn't being run as a module, but rather in CGI
mode... At least that might explain why mod_php4.c is commented out.
Another option is that it may not be an Apache server...

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Jul 27 '05 #7
For the record, PHP's ini_set() function cannot be used to change the value
of register_globals at run-time.

http://us2.php.net/manual/en/ini.cor...gister-globals

ECRIA
http://www.ecria.com
<sh************@gmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Use the ini_set() function to change the values of the variables.

Thanks
Shabbir Bhimani

Jul 27 '05 #8
It is an apache server for sure. In any case, putting php.ini in the
root folder is the best solution as I can tweak it as I please :D

Jul 28 '05 #9
This is what I did and it works flawlessly. Problem is is now it is
accessible to the www. Is there a way to put it somewhere else not
accessible by apache, but where php can read it?

Jul 29 '05 #10
On 29 Jul 2005 15:09:43 -0700, ae*****@gmail.com wrote:
This is what I did and it works flawlessly. Problem is is now it is
accessible to the www. Is there a way to put it somewhere else not
accessible by apache, but where php can read it?


Just _what_ are you nattering on about?
Oh, I see the problem:
X-Trace: posting.google.com

http://groups.google.com/googlegroup...html#summarize
http://oakroadsystems.com/genl/unice.htm#quote
Jul 30 '05 #11
> Just _what_ are you nattering on about?
Oh, I see the problem:
X-Trace: posting.google.com

http://groups.google.com/googlegroup...html#summarize
http://oakroadsystems.com/genl/unice.htm#quote


Thank you very much in directing me to those resources, nicely :D I
understand that other people would have taken this opportunity to say
some very unkind words ;)

I have taken note of this and this here is the result :)

Cheers,
Ahmed El-Daly

Aug 2 '05 #12
Rob wrote:
sh************@gmail.com wrote:
Use the ini_set() function to change the values of the variables.

Thanks
Shabbir Bhimani


alternatively you can upload your own php.ini to the root of your shared
web space.
PHP always checks for php.ini in the root of the document before it
checks elsewhere.

:)


Yes, thanks. As I said earlier, this works. Problem is is now it is
accessible to anyone who care to check for it:
http://servername/php.ini. I would say that this is probably a security
risk? (not sure). Is there a way to put it somewhere else not
accessible by apache, but where php can read it? I tried changing the
permissions on the file, but that has not helped.

Thanks,
Ahmed El-Daly

Aug 2 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Useko Netsumi | last post by:
in php.ini? Thank
6
by: wonder | last post by:
Hi, The CRM application said that need to add an option "REGISTER_GLOBALS=On" to the php.ini file, so I did what it told. But I still can't get rid off the following error: The PHP variable...
15
by: news | last post by:
You'd think it'd be easier to find the answer to this question. Did a search, and all I can find is people asking why something's not working and people replying it's because register_globals is...
17
by: peter | last post by:
I just took over the website at work. I am still learning PHP. Register_globals are on and the script appears to be coded to take advantage of this. I know how to recode the script, but am unsure...
4
by: Angelos Devletoglou | last post by:
Hi... It drives me nuts this server. My php.ini says that register_globals is OFF and when I run phpinfo() it says they are ON. I restarted both httpd and the whole server still nothing. IS...
5
by: Samuel Shulman | last post by:
I keep getting the 'FATAL ERROR: register_globals is disabled in php.ini, please enable it!' error I changes that settings and I still get this error What should I do next? Thank you,...
12
by: Dave | last post by:
In PHP 4.4, what is the most secure server configuration while keeping REGISTER_GLOBALS on?
4
by: bnashenas1984 | last post by:
Hi everyone I'v been working on my scripts more that 5 months using Microfoft IIS on windows XP. As default the ( register_globals ) was ON ( php.ini ) and that means I didnt need to use ( $_request...
8
by: +mrcakey | last post by:
I understand that register_globals was turned off by default as, unless you initialised it, it could be altered by a malicious coder. What I don't understand is how the $_POST form is any more...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.