I have to go a little nerd on you. I’ve been working on my AIX test system trying to get Apache2 and PHP5 installed. The reason for this is because I want to setup drupal with a DB2 backend. Once, if, I get this working I plan on setting up a team page for my co-workers.
Why am I putting this on SirRobbieRob.com? Just in the case this system completely dies on me, I don’t want to have to figure it out again. So, more than anything, it’s here for my reference.
Prerequisites
1. Make sure you have the necessary free space in the following filesystems:
* /usr
* /opt
* /home
* /tmp
2. Download the following:
* Apache Web Server 2.2.2 source code - link
* GNU C compiler version 4 for AIX 5.3 - link
* GCC library for AIX 5.3 - link
* PHP 5.1 source code - link
* XML support – IBM’s AIX Toolbox for Linux Applications is back rev’d. Use these instead
libxml2 2.6.21
libxml2-devel
General tools from IBM AIX Toolbox Download Page
o LEX flex-2.5
o XML support expat-1.95.7
o Compression library zlib-1.2.2
o Compression develoment zlib-devel-1.2.2
o Compression library bz2-1.0.2-3
o jpeg support libjpeg-6b-6
o jpeg support development libjpeg-devel-6b-6
o png support libpng-1.2.1-6
o png development libpng-devel-1.2.1-6
o Pixmap xpm-3.4k
o Pixmap development xpm-devel-3.4k
o Freetype2 fonts freetype2-2.1.7-2
o Freetype2 fonts development freetype2-devel-2.1.7-2
o Gettext support gettext-0.10.40
o Any other libraries you might need for Apache or PHP
* Install all the RPM files
3. Install libm.a from the AIX CDROM
4. Install the compiler and library
rpm -Uvh gcc-4*.rpm
rpm -Uvh libgcc-4*rpm
Compiling Apache2 using GCC
1. Uncompress the Apache Web Server source into your home directory
# gunzip httpd-2*tar.gz
# tar xvf httpd-2*.tar
# cd httpd*
2. Build the configuration file enabling shared object
# ./configure
3. Compile the server
#slibclean
# make
4. Install the server (/usr/local/apache2)
# make install
Compiling PHP using GCC
1. Uncompress the PHP source code file and untar the file
# gunzip php*tar.gz
# tar xvf php*.tar
# cd php-5.1.4
2. Build the configuration file enabling shared objects
# export PATH=/opt/freeware/bin:$PATH
# ./configure –prefix=/usr/local –with-apxs2=/usr/local/apache2/bin/apxs –with-config-file-path=/usr/local/apache2/conf –with-gd –with-pear –with-gettext –with-mime-magic –with-zlib-dir=/opt/freeware/lib –enable-shared –disable-static –with-png –with-zlib –with-bz2 –with-xml –with-jpeg-dir=/opt/freeware/lib –with-png-dir=/opt/freeware/lib –with-xpm-dir=/opt/freeware/lib –with-freetype-dir=/opt/freeware/lib
3. Compile PHP with the following command:
# make
NOTE: There will be compiler warnings about pointers type mismatches. The can be disregarded.
4. Install PHP with the following two commands
# cp .libs/libphp5.so /usr/local/apache2/modules
# cp php.ini-recommended /usr/local/apache2/conf/php.ini
Configuring Apache2 with PHP
1. Stop Apache2
# /usr/local/apache2/bin/apachectl -k stop
2. Edit /usr/local/apache2/conf/httpd.conf, adding the following at the end
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
DirectoryIndex index.php
3. Edit the /usr/local/apache2/conf/php.ini file
Change the php variable:
;date.timezone =
to reflect your timezone
4. Restart Apache2
# /usr/local/apache2/bin/apachectl -k start
5. Now test PHP with Apache2
* Create a test web page
# vi /usr/local/apache2/htdocs/phpinfo.php
<?php phpinfo() ?>
* Open the page in your browser: http://localhost/phpinfo.php
* Verify the php data
* Delete phpinfo.php
# rm /usr/local/apache2/htdocs/phpinfo.php