PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<Mac OS X 系统下的安装在 MacOS X 客户版编译>
Last updated: Mon, 16 Jul 2012

在 MacOS X 服务器版编译

Mac OS X 服务器安装.

  1. 获得最新版本的 Apache 和 PHP。

  2. 将它们的 tar 包解压,然后在 Apache 运行 configure 程序。
    ./configure --exec-prefix=/usr \
    --localstatedir=/var \
    --mandir=/usr/share/man \
    --libexecdir=/System/Library/Apache/Modules \
    --iconsdir=/System/Library/Apache/Icons \
    --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \
    --enable-shared=max \
    --enable-module=most \
    --target=apache

  3. 如果您想对编译做些优化,您可以添加下面一行:
    setenv OPTIM=-O2

  4. 接下来,进入 PHP 4 源代码目录,并进行 configure 操作。
    ./configure --prefix=/usr \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --mandir=/usr/share/man \
        --with-xml \
        --with-apache=/src/apache_1.3.12
    如果您需要其它附加功能(MySQL、GD 等),务必将它们添加到这里。对于 --with-apache 参数,您需要将其路径指向 Apache 源代码目录,例如 /src/apache_1.3.12

  5. 输入 makemake install。这样在 Apache 源代码目录中会创建一名为 src/modules/php4 的目录。

  6. 现在,重新配置 Apache 以编译 PHP 4。Now, reconfigure Apache to build in PHP 4.
    ./configure --exec-prefix=/usr \
    --localstatedir=/var \
    --mandir=/usr/share/man \
    --libexecdir=/System/Library/Apache/Modules \
    --iconsdir=/System/Library/Apache/Icons \
    --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \
    --enable-shared=max \
    --enable-module=most \
    --target=apache \
    --activate-module=src/modules/php4/libphp4.a
    您可能会被告知 libmodphp4.a 太旧了。如果出现这个情况,进入 Apache 源代码目录中的 src/modules/php4 目录,并运行该命令: ranlib libmodphp4.a。然后返回到 Apache 源代码根目录,再次运行上面的 configure 命令。这样便会更新链接表。然后再次运行 makemake install 命令。

  7. 从 PHP 4 源代码目录复制并重命名 php.ini-dist 文件到 bin 目录: cp php.ini-dist /usr/local/bin/php.ini 或(如果您的电脑上没有 local 目录) cp php.ini-dist /usr/bin/php.ini




<Mac OS X 系统下的安装在 MacOS X 客户版编译>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST