MAMP PRO + register globals

834 Views Asked by At

i've just started using MAMP pro, and whilst convertin all my Projects from ol' fashioned XAMPP to MAMP because of my switch from Win to Mac, i struggle with the php.ini-Options of MAMP Pro.

In special :

I have project which relies on register_globals. this is bad enough, i know, but nobody is going to pay for the kindness of removing this silly stuff.

But besides that, i can't get register_globals to work within MAMP, editing the php.ini with textwrangler and restarting the server does not have any effect. Also using File->Edit Templates does not do anything.

So, how can i get register_globals on with MAMP Pro. And yes, i tried .htaccess-ing ...

Thanks

Florian

3

There are 3 best solutions below

3
On

Well, the only suitable way i found was :

  1. Remove MAMP
  2. Install VirutalBox + Windows
  3. Get Back to an classical LAMP ...
0
On

I am using MAMP 3.0.6 and selected php 5.1.6 for a pretty much old project.

Opened the php.ini file at /Applications/MAMP/bin/php/php5.1.6/conf/php.ini and then did set register_globals = On

Worked like a charm.

0
On

You really shouldn't rely on register_globals, because it is completely removed from PHP 5.4 and higher!

If you really just need to make this project work, and get on with your life, you could make your own implementation:

function my_register_globals(){
    $gpcs = array($_GET,$_POST,$_COOKIE,$_SESSION);
    foreach((array)$gpcs as &$arr){
        foreach((array) $arr as $k => &$v){
            $GLOBALS[$k] = $v;
        }
    }
}

But my best recommendation is always to just scrap the project or rewrite if it uses register_globals!