www.michalscorner.com what I have recently discovered

1Apr/090

php 5.2.8 on AIX 5.3 with mysql support

Tough excercise I would say, definately on the beginning nevertheless I was able to make it. Let me share with you how to compile php 5 with mysql support on 64bit platform running AIX 5.3.

Preparation:

  1. Download sources from PHP.net site
    wget http://cz.php.net/get/php-5.2.9.tar.gz/from/us.php.net/mirror
  2. extract it to temporary location
    gzip -d php-5.2.9.tar.gz
    tar -xvf php-5.2.9.tar

Compiling PHP:

  1. Configure
    ./configure --prefix=/usr/local --enable-module=so --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/apache2/conf --with-png-dir=/opt/freeware/include/libpng/png.h --with-zlib-dir=/opt/freeware/lib --enable-shared --disable-static --with-zlib --with-bz2 --with-libxml-dir=/opt/freeware/include/libxml2 --with-jpeg-dir=/opt/freeware/lib --with-png-dir=/opt/freeware/lib --with-xpm-dir=/opt/freeware/lib --with-freetype-dir=/opt/freeware/lib --with-mysql=/usr/local/mysql
  2. edit pcre_internal.h accordingly to the below output
    vi ./ext/pcre/pcrelib/pcre_internal.h

    *** 562,570 ****
      /* Miscellaneous definitions. The #ifndef is to pacify compiler
    warnings in
      environments where these macros are defined elsewhere. */
    
    ! #ifndef FALSE
      typedef int BOOL;
    
      #define FALSE   0
      #define TRUE    1
      #endif
    --- 562,572 ----
      /* Miscellaneous definitions. The #ifndef is to pacify compiler
    warnings in
      environments where these macros are defined elsewhere. */
    
    ! #ifndef BOOL
      typedef int BOOL;
    + #endif
    
    + #ifndef FALSE
      #define FALSE   0
      #define TRUE    1
      #endif
  3. Execute make
    make

Post installation:

  1. Navigate to libraries
    cd /tmp/install/php/php5.2.8/libs
  2. Convert library from static to dinamic
    ar -x libphp5.a
  3. Copy dynamic library to apache modules location
    cp libphp5.so /usr/local/apache2/modules/
  4. Apply necessary changes to httpd.conf file so, php module will be loaded on startup
    LoadModule php5_module modules/libphp5.so
    AddType application/x-httpd-php .php
    DirectoryIndex index.html, index.php
  5. Restart apache stack

11Mar/092

linux tools on AIX

I have realized you may find some posts speaking about how to compile/install certain linux things on AIX but I have forgot to mention about pre-requisites. So, here is the corrective post.

Whenever you want to compile/install any of the linux applications there are several binaries and libraries required to allow you complete that task. Which in my understanding is at the end having application up and running.

How should you proceed than? Well, except exploring what are the requirements of the application you want to install you should get incorporate below mentioned binaries installed into your AIX os:

  1. RPM - will allow you to install rest of the packages - Download
  2. GCC-C++ - GNU c++ compiler along with - Download
    1. libstdc++ - Download
    2. libstdc++-devel - Download
  3. GCC- GNUc compiler followed by - Download
    1. libgcc - Download

See below how to do it

  1. Download rpm.rte
    wget ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/INSTALLP/ppc/rpm.rte
  2. install rpm package to be able to install rpm packages
    installp -qaXgd rpm.rte rpm.rte
  3. install all above mentioned compile packages with additional libraries (you may install oll of them at once - just separate ftp links by space
    rpm -ihv <RPM_LOCATION> <RPM_LOCATION>

You are done with basic preparation. Now you should explore which other packages/libraries/binries application you want to install is dependent on.

For complete list of Linux Tools please visit IBM Toolbox page where you will get instructions, licenses and packages.