# register\_globals

**URL:** <https://forum.kirupa.com/t/register-globals/61619>\
**Category:** programming\
**Created:** [August 20, 2004, 1:34am UTC](https://forum.kirupa.com/t/register-globals/61619 "2004-08-20T01:34:50Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)\
**Post date:** [August 20, 2004, 1:34am UTC](https://forum.kirupa.com/t/register-globals/61619/1 "2004-08-20T01:34:50Z")

</div>

Hi,

Have mercy on the newbie. I’'m running php 4 on MAC OS 10.2.8, how do I turn on register \_globals? I’m not shy of terminal so let fly with the tech.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 6:03am UTC](https://forum.kirupa.com/t/register-globals/61619/2 "2004-08-20T06:03:16Z")

</div>

OK… register\_globals is technically a security risk and all that crap… but meh… if ya know what you’re doing…

in the terminal:

```auto

phpinipath=`find / | grep php.ini`;cat $phpinipath | sed "s/register_globals = Off/register_globals = On/" > $phpinipath

```

May only work as root though.  
(tested on bash 2.05b under linux, but should be similar)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 6:19am UTC](https://forum.kirupa.com/t/register-globals/61619/3 "2004-08-20T06:19:35Z")

</div>

edit php.ini, should be located in /etc/ or in /usr/local/etc/

register\_globals is only a security risk if you use them improperly. But there really isn’t any reason to use them since you can use super\_global arrays like $\_POST and $\_GET.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 8:25am UTC](https://forum.kirupa.com/t/register-globals/61619/4 "2004-08-20T08:25:28Z")

</div>

> [@Marble](#):
>
> edit php.ini, should be located in /etc/ or in /usr/local/etc/
> 
> register\_globals is only a security risk if you use them improperly. But there really isn’t any reason to use them since you can use super\_global arrays like $\_POST and $\_GET.

He’s on OSX, that puts php.ini in a different location (I can’t remember where though, so I just used find / in the script I wrote)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 1:51pm UTC](https://forum.kirupa.com/t/register-globals/61619/5 "2004-08-20T13:51:45Z")

</div>

> [@njs12345](#):
>
> He’s on OSX, that puts php.ini in a different location (I can’t remember where though, so I just used find / in the script I wrote)

Hi,

I’m only using the register \_globals for training, I found a tutorial on changing the php.ini file and it’s working. Thanks for the prompt replies.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 2:30pm UTC](https://forum.kirupa.com/t/register-globals/61619/6 "2004-08-20T14:30:51Z")

</div>

> [@cki](#):
>
> Hi,
> 
> I’m only using the register \_globals for training, I found a tutorial on changing the php.ini file and it’s working. Thanks for the prompt replies.

Where is php.ini located? I was wondering since in FreeBSD it’s /usr/local/etc/ and since Darwin is influenced by FreeBSD, thought it might be there…?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 2:51pm UTC](https://forum.kirupa.com/t/register-globals/61619/7 "2004-08-20T14:51:14Z")

</div>

> [@Marble](#):
>
> Where is php.ini located? I was wondering since in FreeBSD it’s /usr/local/etc/ and since Darwin is influenced by FreeBSD, thought it might be there…?

Hi,

After pasteing this path into Safari, the folder was opened in the finder.

/usr/local/php/lib/php.ini

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 3:36pm UTC](https://forum.kirupa.com/t/register-globals/61619/8 "2004-08-20T15:36:34Z")

</div>

Weird. .ini files are config files, which if they stuck to a unix system they belong in \*/etc. Lib directories are for modules and libraries … Did you install using ports or from a download?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 3:52pm UTC](https://forum.kirupa.com/t/register-globals/61619/9 "2004-08-20T15:52:33Z")

</div>

> [@Marble](#):
>
> Weird. .ini files are config files, which if they stuck to a unix system they belong in \*/etc. Lib directories are for modules and libraries … Did you install using ports or from a download?

from a download at the following  
[http://www.entropy.ch/software/macosx/](http://www.entropy.ch/software/macosx/)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 4:20pm UTC](https://forum.kirupa.com/t/register-globals/61619/10 "2004-08-20T16:20:21Z")

</div>

I thought Mac OSx had a ports tree? If so you should use that.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 4:36pm UTC](https://forum.kirupa.com/t/register-globals/61619/11 "2004-08-20T16:36:02Z")

</div>

> [@Marble](#):
>
> I thought Mac OSx had a ports tree? If so you should use that.

I’m just starting PHP/MySQL, have no idea why or how to use a ports tree. Please elaborate. The install package has proven stable for me and many others, bu I would like to learn as much as possible.

C

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 4:52pm UTC](https://forum.kirupa.com/t/register-globals/61619/12 "2004-08-20T16:52:20Z")

</div>

I was trying to find out more about ports on Mac OSx and it’s still in development it seems. [http://darwinports.opendarwin.org/](http://darwinports.opendarwin.org/) - not very many apps are in there. There are a few hundred or so, versus 10,000+ on FreeBSD. But soon, hopefully.

But in a nutshell, the ports system is built into the BSD’s and Gentoo Linux (which came from FreeBSD method of ports). It’s an intelligent method of handling applications that will be installed from source. They are easy to update and install and the applications are “ported” for that OS. The BSD’s also have a linux binary port, so if there isn’t a port you can install the Linux version from source. Mac OSx probably has that as well. But I am guessing…

So for instance if you were to install php / apache / mysql from ports you would update your ports tree (simple - run a command) and when installing, any dependencies would be handled. There is a ports database that monitors your ports tree and in the event you want to uninstall a port it will uninstall all binaries and files associated with that port that are not being used by another app.

But I sure wish I had a Mac so I could dump this WinXP crap.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 5:35pm UTC](https://forum.kirupa.com/t/register-globals/61619/13 "2004-08-20T17:35:20Z")

</div>

> [@Marble](#):
>
> I was trying to find out more about ports on Mac OSx and it’s still in development it seems. [http://darwinports.opendarwin.org/](http://darwinports.opendarwin.org/) - not very many apps are in there. There are a few hundred or so, versus 10,000+ on FreeBSD. But soon, hopefully.
> 
> But in a nutshell, the ports system is built into the BSD’s and Gentoo Linux (which came from FreeBSD method of ports). It’s an intelligent method of handling applications that will be installed from source. They are easy to update and install and the applications are “ported” for that OS. The BSD’s also have a linux binary port, so if there isn’t a port you can install the Linux version from source. Mac OSx probably has that as well. But I am guessing…
> 
> So for instance if you were to install php / apache / mysql from ports you would update your ports tree (simple - run a command) and when installing, any dependencies would be handled. There is a ports database that monitors your ports tree and in the event you want to uninstall a port it will uninstall all binaries and files associated with that port that are not being used by another app.
> 
> But I sure wish I had a Mac so I could dump this WinXP crap.

Thanks,

A little over my head at this juncture, I’ll look you up when the time comes. As for MAC vs PC, I’ve worked with both and find working with the PC like having to tune a piano each time before playing.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 7:12pm UTC](https://forum.kirupa.com/t/register-globals/61619/14 "2004-08-20T19:12:14Z")

</div>

I like Macs quite a bit now (since OSx)… I think it’s one of the best desktops out there. I worked with Macs pre OSx and never bought the Mac is better than PC hype. But now I am convinced. I know people that use them alot and never have the kinds of issues I experience with WinXP pro. Eventually I will ditch Xp and just run Mac OSx, FreeBSD as a server and some Linux desktop (Fedora probably) … but macs are expensive.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 8:43pm UTC](https://forum.kirupa.com/t/register-globals/61619/15 "2004-08-20T20:43:04Z")

</div>

Hi,

They’re more expensive, but prove worth the extra coin with ease of use and out-of-box features.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 8:46pm UTC](https://forum.kirupa.com/t/register-globals/61619/16 "2004-08-20T20:46:42Z")

</div>

> [@cki](#):
>
> Hi,
> 
> They’re more expensive, but prove worth the extra coin with ease of use and out-of-box features.

Yeah, I know what you mean. I may look into the apple loan once work picks up. But my tastes put me into the $6K+ range for a G5 - lol…

What are you using? I was also thinking of getting a 12" powerbook and just use my monitor when I am at home.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 20, 2004, 9:29pm UTC](https://forum.kirupa.com/t/register-globals/61619/17 "2004-08-20T21:29:41Z")

</div>

> [@Marble](#):
>
> Yeah, I know what you mean. I may look into the apple loan once work picks up. But my tastes put me into the $6K+ range for a G5 - lol…
> 
> What are you using? I was also thinking of getting a 12" powerbook and just use my monitor when I am at home.

Jockn’ a 15" G4 powerbook, external 120GB firewire drive.
