Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Please help meganewbie with php 'register_globals'

Please help meganewbie with php 'register_globals'
Thread Tools
Mac Enthusiast
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 25, 2003, 09:21 AM
 
Hi,

I'm wanting to install phpgroupware on my box, to run on our internat network.

I have almost no idea what I am doing but I have managed to stumble through installing php, mySQL and phpMyAdmin as well as phpcollab.

I didn't find that phpcollab did what I wanted and so need to turn to phpgroupware.

I installed php and mySQL using Marc Liyanage's packages at http://www.entropy.ch/home/welcome.html.

The install instructions which come with phpgroupware require php register_globals to be 'On'

It says to set this in the 'php.ini' file. Marc Liyanage's packages come without this file. Following *his* instructions I created the file
(sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini)

The file now exists but is of course blank.

What exactly to I put in that file to set register_globals to be 'On'?

Also: I'm still petrified of the terminal. Does it come to the same thing to use bbEdit to change my files?

Sorry about the lengthy posting

Thanks for your help!

Simon
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Mar 25, 2003, 09:53 AM
 
Originally posted by simonmartin:
Hi,

I'm wanting to install phpgroupware on my box, to run on our internat network.

I have almost no idea what I am doing but I have managed to stumble through installing php, mySQL and phpMyAdmin as well as phpcollab.

I didn't find that phpcollab did what I wanted and so need to turn to phpgroupware.

I installed php and mySQL using Marc Liyanage's packages at http://www.entropy.ch/home/welcome.html.

The install instructions which come with phpgroupware require php register_globals to be 'On'

It says to set this in the 'php.ini' file. Marc Liyanage's packages come without this file. Following *his* instructions I created the file
(sudo mkdir -p /usr/local/lib
sudo touch /usr/local/lib/php.ini)

The file now exists but is of course blank.

What exactly to I put in that file to set register_globals to be 'On'?

Also: I'm still petrified of the terminal. Does it come to the same thing to use bbEdit to change my files?

Sorry about the lengthy posting

Thanks for your help!

Simon
I always found those instructions to be a bit mystifying...

You can find the php.ini-dist file if you download the source files from php.net. Do a search for that file and it should show up. Just copy the contents of that into the new php.ini file you've created. You can do that using BBEdit if you like, but you'll probably need to do it as root.

From inside that file, you can easily find the instructions to turn register_globals_on, although there has been a good reason to turn it off by default (see php.net for more details).

I'd petition phpgroupware to update to a more modern way of writing php!
Computer thez nohhh...
     
Mac Enthusiast
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 25, 2003, 10:08 AM
 
Originally posted by Simon Mundy:
I always found those instructions to be a bit mystifying...

You can find the php.ini-dist file if you download the source files from php.net. Do a search for that file and it should show up. Just copy the contents of that into the new php.ini file you've created. You can do that using BBEdit if you like, but you'll probably need to do it as root.

From inside that file, you can easily find the instructions to turn register_globals_on, although there has been a good reason to turn it off by default (see php.net for more details).

I'd petition phpgroupware to update to a more modern way of writing php!
Simon,

Thanks for that, just downloading now.

It looks as if phpgroupware is moving toward a version which uses register_globals off.

Question: If one php program needs register_globals on and another needs them off, does it mean that you simply can't run those two together?

Thanks!

Simon
     
Mac Enthusiast
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 25, 2003, 10:33 AM
 
Originally posted by Simon Mundy:
I always found those instructions to be a bit mystifying...

You can find the php.ini-dist file if you download the source files from php.net. Do a search for that file and it should show up. Just copy the contents of that into the new php.ini file you've created. You can do that using BBEdit if you like, but you'll probably need to do it as root.

From inside that file, you can easily find the instructions to turn register_globals_on, although there has been a good reason to turn it off by default (see php.net for more details).

I'd petition phpgroupware to update to a more modern way of writing php!
Simon,

Sorry...

I searched the file for any reference to 'global' and the only sections I found are:

; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; 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

; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, albeit register_globals
; is disabled. PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning seperately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled.

That's it.

Did you mean a different file?

Hope you can get me a bit further...

Thanks

Simon
     
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Mar 25, 2003, 02:02 PM
 
Question: If one php program needs register_globals on and another needs them off, does it mean that you simply can't run those two together?
The register_globals on setting will be compatible with all code, even that written for the register_globals off setting. However running with register_globals on represents a security risk and should be avoided if possible. Tis far better to bring one's code up to compatibility with the register_globals off setting.

The difference is that register_globals off setting requires a shroud around variables, whereas in the more permissive register_globals on setting the shroud is optional. It is the requirement of the shroud which adds security.
     
Mac Enthusiast
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 26, 2003, 02:42 AM
 
Originally posted by Rainy Day:
The register_globals on setting will be compatible with all code, even that written for the register_globals off setting. However running with register_globals on represents a security risk and should be avoided if possible. Tis far better to bring one's code up to compatibility with the register_globals off setting.

The difference is that register_globals off setting requires a shroud around variables, whereas in the more permissive register_globals on setting the shroud is optional. It is the requirement of the shroud which adds security.
Rainy Day,

Thanks for that.

I still don't know how to set this in the php.ini file though.

Can you give me any pointers?

Thanks

Simon
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Mar 26, 2003, 06:46 AM
 
Originally posted by simonmartin:
Simon,

Sorry...

I searched the file for any reference to 'global' and the only sections I found are:

register_globals = Off

Simon
That's it right there. Change that to 'On' and you're away.

Don't bother with all that "bug_compat_42" malarky - either you have it on or you don't. And I still recommend you don't
Computer thez nohhh...
     
Mac Enthusiast
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 26, 2003, 07:19 AM
 
Originally posted by Simon Mundy:
That's it right there. Change that to 'On' and you're away.

Don't bother with all that "bug_compat_42" malarky - either you have it on or you don't. And I still recommend you don't
Simon,

Sorry, don't know what's the matter with me... It looked like part of the instructions as opposed to a part of the code.

Right... plow on.

Thanks again. More questions to come I'm sure...

Simon
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2