Sun Java Web Server 7u8 – PHP Compile with NSAPI

After more than years do not have time to hands develop on Solaris 10, now I try to share my successful compilation of PHP using NSAPI with Sun Java Web Server 7u8. I am using gcc from sunfreeware.

Requirements software to be installed from sunfreeware:
SMCexpat expat
SMCfontc fontconfig
SMCftype freetype
SMCgcc gcc
SMCgd gd
SMCjpeg jpeg
SMClibpng libpng
SMCliconv libiconv
SMClintl libintl
SMCmake make
SMCzlib zlib
SMCxpm xpm
SMCncurs ncurses
SMCcmake cmake
SMCm4 m4
SMCautoc autoconf
SMCautom automake
SMCbison bison
SMClibt libtool
SMCcoreu coreutils
SMCgmp gmp
SMCperl perl

Download libxml2, compile and install without zlib option, since there is problem with gzopen64, it is in zlib, but unable to find the reference, although ldd shows everything normal.

Download mysql source from mysql (I am using mysql version 5.1.54 from mysql download site) extract and compile with prefix /usr/local/mysql.

Download php source code from php website (I am php version using 5.3.5) extract it what ever you want. Download pcre source tar ball if you need to get PCRE_UTF8 enable, and extract it at $PHP_SOURCE_DIR/ext/pcre and run upgrade_pcre.php.

Regiter your PATH environment variable to use /usr/local/bin:
# export PATH=/usr/local/bin:$PATH:/usr/ccs/bin
Download libmcrypt source code, extract somewhere and compile:
# ./configure --host=i686-sun-solaris2.10 --enable-dynamic-loading
# make && make install

Than configure, compile and install php source as follow:
# ./configure '--prefix=/opt/sun/webserver7/plugins/php' '--bindir=/opt/sun/webserver7/plugins/php/bin' '--libdir=/opt/sun/webserver7/plugins/php/lib' '--libexecdir=/opt/sun/webserver7/plugins/php/libexec' '--disable-static' '--enable-shared' '--enable-cli' '--disable-cgi' '--with-pic' '--with-nsapi=/opt/sun/webserver7' '--enable-cgi' '--disable-rpath' '--enable-safe-mode' '--enable-ftp' '--enable-sockets' '--enable-inline-optimization' '--enable-soap' '--enable-dba=shared' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-sqlite-utf8' '--enable-zend-multibyte' '--enable-bcmath' '--enable-exif' '--enable-magic-quotes' '--enable-wddx' '--enable-mbstring' '--enable-mbregex' '--enable-gd-native-ttf' '--with-iconv-dir=/usr/local' '--with-libxml-dir=/usr/local' '--with-zlib=/usr/local' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-gd=/usr/local/' '--with-pear=/opt/sun/webserver7/plugins/php/include/php' '--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--enable-exif' '--with-xpm-dir=/usr/local' '--enable-maintainer-zts' '--enable-sigchild' '--host=i686-sun-solaris2.10' '--enable-sigchild' '--with-mcrypt=/usr/local'
# make -j4 && make install
# cp libs/libphp5* /opt/sun/webserver7/plugins/php


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: