register_globals

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.

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

in the terminal:


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)

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)

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…?

Hi,

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

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

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/

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

I was trying to find out more about ports on Mac OSx and it’s still in development it seems. 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.

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.

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.

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