Pages

Monday, November 8, 2010

Install Apache-PHP 4 on Centos 5.5

I have a project to migrate a server to a new machine. Currently using Centos 4.6 with services like: php4, postgresql, mysql, etc.
Since version 5, Centos is not including php4 packet in their distribution. So i have 2 choice:

  1. keeping the current OS version and update the kernel
  2. use the latest OS version and install php4 manually
My friend suggest option #2. I tried that and well done!!
Here's the steps:
  1. Download php-4.4.9 and apache-1.3.42
  2. Install apache, this should be easy.
  3. Install php, this is the main challenge. the detail is next..
  4. i'd use these modules: mysql, pgsql, gd. Then i installs devel packet of each modules.
  5. It looks like gd requires zlib, jpeg, and png.. si i installed those packets with the devel parts.
  6. Then i configure php
  7. ./configure --with-mysql --with-apxs=/opt/apache/bin/apxs --with-pgsql=/usr/lib/pgsql/ --with-gd --with-jpeg-dir --with-zlib-dir --with-png-dir
  8. make
  9. make install
  10. set "LoadModule php4_module libexec/libphp4.so" on httpd.conf
  11. start apache
  12. Done

[root@vmware php-4.4.9]# make install
Installing PHP SAPI module: apache
[activating module `php4' in /opt/apache/conf/httpd.conf]
cp libs/libphp4.so /opt/apache/libexec/libphp4.so
chmod 755 /opt/apache/libexec/libphp4.so
cp /opt/apache/conf/httpd.conf /opt/apache/conf/httpd.conf.bak
cp /opt/apache/conf/httpd.conf.new /opt/apache/conf/httpd.conf
rm /opt/apache/conf/httpd.conf.new
Installing PHP CLI binary: /usr/local/bin/
Installing PHP CLI man page: /usr/local/man/man1/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - installed: 1.3.2
[PEAR] Console_Getopt - installed: 1.2.1
[PEAR] HTML_Template_IT- installed: 1.1
[PEAR] Net_UserAgent_Detect- installed: 2.0.1
warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.2)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR - installed: 1.5.0
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] Structures_Graph- installed: 1.0.2
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/man/man1/
page: phpize.1
page: php-config.1

No comments:

Post a Comment