Configure and apply PHP4 to Apache source

Securing and Optimizing Linux: RedHat Edition -A Hands on Guide
Prev | Chapter 29. Software -Network Server, web/Apache | Next

# 29.5. Configure and apply PHP4 to Apache source

Now, move into the new php4 directory cd `../php-4.0` and type the following commands on your terminal:

1. Edit the `php_pgsql.h` file, vi `ext/pgsql/php_pgsql.h` and change the lines:

                 #include libpq-fe.h
                 #include libpq/libpq-fs.h

   To read:

                 #include /usr/include/pgsql/libpq-fe.h
                 #include /usr/include/pgsql/libpq/libpq-fs.h

   These modifications in the `php_pgsql.h` file are necessary to indicate the location of our `libpq-fe.h`, and `libpq-fs.h` header files of PostgreSQL database during configure of PHP4. In Red Hat Linux, the libraries of PostgreSQL are located under `/usr/include/pgsql.`

2. Now, we must configure and install PHP4 in the Linux server:

                 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 \
                 --with-ldap \
                 --with-pgsql \
                 --with-mm \
                 --enable-inline-optimization \
                 --with-gnu-ld \
                 --enable-memory-limit

     If you want IMAP & POP support.
     If you want LDAP database light directory support.
     if you want PostgreSQL database support.
   This tells PHP4 to set itself up for this particular hardware setup with:

   - Compile without debugging symbols.

   - Enable safe mode by default.

   - Include IMAP & POP support.

   - Include LDAP directory support.

   - Include PostgresSQL database support.

   - Include mm support to improve performance of Memory Library.

   - Enable inline-optimization for better performance.

   - Compile with memory limit support.

   - Assume the C compiler uses GNU ld.

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

Prev | Home | Next
Compile and Optimize | Up | Apply mod_perl to Apache source tree