473,800 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

turn off register_global s on a shared server

Hello all,

My shared server provider has register_global s 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_global s 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 3301
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
ae*****@gmail.c om wrote:
Hello all,

My shared server provider has register_global s 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_global s 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_global s 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.c om wrote:
Hello all,

My shared server provider has register_global s 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.go oglegroups.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_global s off in the .htaccess file caused a
500 error for some reason!

Thanks to all that replied.

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

setting php_flag register_global s 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.co m
http://koivi.com
Jul 27 '05 #7
For the record, PHP's ini_set() function cannot be used to change the value
of register_global s 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.goo glegroups.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

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

Similar topics

3
2091
by: Useko Netsumi | last post by:
in php.ini? Thank
6
2521
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 "REGISTER_GLOBALS" is disabled (0). This is fatal. Edit your php.ini and set REGISTER_GLOBALS to "On". I changed the value "On" to "Yes", still getting the same error.
15
3400
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 off. I found one person said: "The change is for the better since register_global turned to on had some grim security implications." but no mentioning of what those are! I'm working on a server now, with a couple hundred PHP pages someone has...
17
2925
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 how to turn them off when I am done. I have googled and came up with placing php_flag register_globals off in the .htaccess file.
4
4467
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 there any other place that my php environment is set ? It is a dedicated server.. so no shared environment. If you had that before and you know the answer I'll be happy to listen/read
5
4734
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, Samuel
12
1854
by: Dave | last post by:
In PHP 4.4, what is the most secure server configuration while keeping REGISTER_GLOBALS on?
4
1542
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 ) to get the variables from URL. I bought a webspace for 2 weeks ago and realized that ( register_globals ) is turned off on the server. I contacted the support center but they said its not possible for them to turn it on ( because of some...
8
1797
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 secure. Surely Mr Malicious Coder can still just send his own version of $_POST? Obviously I'm missing something, I just can't figure out what! +mrcakey
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.