29.5. 配置并将 PHP4 应用于 Apache 源代码

现在,移动到新的 php4 目录 cd../php-4.0并在您的终端上键入以下命令

  1. 编辑php_pgsql.h文件,viext/pgsql/php_pgsql.h并更改以下行
              #include libpq-fe.h
              #include libpq/libpq-fs.h
            
    改为读取
              #include /usr/include/pgsql/libpq-fe.h
              #include /usr/include/pgsql/libpq/libpq-fs.h
            
    这些修改在php_pgsql.h文件中是必要的,以指示我们的libpq-fe.h,以及libpq-fs.hPHP4 配置期间 PostgreSQL 数据库的头文件。在 Red Hat Linux 中,PostgreSQL 的库位于/usr/include/pgsql.

  2. 现在,我们必须在 Linux 服务器中配置并安装 PHP4
              CC="egcs" \
              CFLAGS="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions -I/usr/include/openssl" \
              ./configure \
              --prefix=/usr \
              --with-exec-dir=/usr/bin \
              --with-apache=../apache_1.3.12 \
              --with-config-file-path=/etc/httpd \
              --disable-debug \
              --enable-safe-mode \
              --with-imap \                (1)
              --with-ldap \                (2)
              --with-pgsql \               (3)
              --with-mm \
              --enable-inline-optimization \
              --with-gnu-ld \
              --enable-memory-limit
            

    (1)
    如果您想要 IMAP 和 POP 支持。
    (2)
    如果您想要 LDAP 数据库轻型目录支持。
    (3)
    如果您想要 PostgreSQL 数据库支持。
    这告诉 PHP4 为此特定硬件设置进行配置,包含以下选项

    • 编译时不包含调试符号。

    • 默认启用安全模式。

    • 包含 IMAP 和 POP 支持。

    • 包含 LDAP 目录支持。

    • 包含 PostgresSQL 数据库支持。

    • 包含 mm 支持以提高内存库的性能。

    • 启用内联优化以获得更好的性能。

    • 编译时包含内存限制支持。

    • 假设 C 编译器使用 GNU ld。

  3.         [root@deep ]/php-4.0# make 
            [root@deep ]/php-4.0# make install