0

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

4

3 回答 3

0

好吧,我找到的唯一合适的方法是:

  1. 删除 MAMP
  2. 安装 VirutalBox + Windows
  3. 回到经典的 LAMP ...
于 2015-01-09T16:20:25.380 回答
0

我正在使用 MAMP 3.0.6 并为一个非常古老的项目选择了 php 5.1.6。

在/Applications/MAMP/bin/php/php5.1.6/conf/php.ini打开 php.ini 文件, 然后设置register_globals = On

像魅力一样工作。

于 2015-04-27T18:23:41.453 回答
0

您真的不应该依赖 register_globals,因为它已从 PHP 5.4 及更高版本中完全删除!

如果你真的只需要让这个项目工作,并继续你的生活,你可以自己实现:

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

但我最好的建议是,如果项目使用 register_globals,则直接废弃或重写!

于 2015-04-27T18:32:16.343 回答