7

我知道您无法在 PowerPC Mac 上安装 MongoDB 服务器,但我找不到任何关于将 PHP 驱动程序安装到 XAMPP 的说明。

有谁知道这是否可能。如果是这样,你怎么做?我已经进行了广泛的搜索,但找不到答案。

4

1 回答 1

15

I dusted off a G4 Powerbook with OS X 10.5.8 to test. Turns out that the current precompiled version of mongo.so for PHP 5.3 on github doesn't support PowerPC (the PHP 5.2 build appears to).

I downloaded the PHP 5.3.1 source to match XAMPP 1.7.3 and compiled my own mongo.so (1.2.12).

I did some minimal testing with XAMPP 1.7.3 on PowerPC to confirm this appears to work. Essentially, I just pasted the example from the MongoDB PHP Driver Tutorial, and inserted some documents into MongoDB 2.0.6 running on another computer.

Note this is an unofficial & unsupported mongo.so build, the same as what you should get building successfully from source with pecl install mongo. As a bonus, this is a much newer driver version than the precompiled OS X ones currently on github.

As a warning: I'm not sure about limitations or quirks of using this on PowerPC. Most of the OS X world has moved on to Intel architecture now.

So, instructions to use:

  1. Download and install XAMPP Mac OS X 1.7.3 universal binary.

  2. Download mongo-ppc-1.2.12.so from my github: mongodb-php-driver/downloads

  3. Rename that to mongo.so and copy into /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/

  4. Edit XAMPP/etc/php.ini and add a last line with:

    extension=mongo.so
    
  5. Check via phpinfo() that the mongo extension is available. Make sure you stop/start Apache if it was already running when you added the extension.

于 2012-08-19T14:53:21.540 回答