How to compile 64bit version of Perl, MySQL, PHP and Apache under Solaris Sparc OS

Inside this article you will find how to compile 64bit version of Perl, MySQL, Apache and PHP on Solaris Sparc server.

1. Perl 64bit configuration and installation:

Go to your perl_5.8.9 source folder and run configure script:

./configure -Dprefix=/usr/local/perl_5.8.9 -Dcc=gcc -Duse64bital -Aldflags=”-mcpu=v9 -m64″ -Alddlflags=”-mcpu=v9 -m64 -G”

Dprefix variable tells where Perl binaries will be installed.

There can be problem with socket module configuration, if so we need to skip him.

 

make

make test

make install

 

( if we are missing make package we need to download and install it – pkgadd -d make-3.81-sol10-sparc-local)

 

2. Mysql-5.1.30 configuration and installation:

First we setup following variables :

export CC=gcc
export CFLAGS=”-m64″
export CXX=gcc
export CXXFLAGS=” -m64″
export LDFLAGS=”-m64 -L/lib/64 -L/usr/sfw/lib/64″
export LD_LIBRARY_PATH=”/opt/sfw/lib”

Then we can start configuration script from mysql source directory:

 

./configure –prefix=/usr/local/mysql_5.4 –localstatedir=/usr/local/mysql_5.4/data \
–libexecdir=/usr/local/mysql_5.4/bin –with-extra-charsets=complex \
–with-server-suffix=-standard –enable-thread-safe-client \
–enable-local-infile –with-big-tables –enable-shared \
–with-readline –with-plugins=max-no-ndb

make

make install

 

we also can add  pbxt engine  :

cd pbxt-1.0.07-rc
./configure –with-mysql=/export/home/michalbi/dbi/mysql-5.1.30

If we have problem with  ar module during compilation we do following steps :

cd sql
/usr/ccs/bin/ar -ts .libs/libndb.a

remember that folder /usr/ccs/bin – need to be in  PATH variable !

We can add him using command:

export PATH=$PATH:/usr/ccs/bin

 

3.  DBI-1.607 installation:

Move to DBI-1.607 source folder and run following commands:

perl Makefile.PL ; make ;make test; make install

 

4. Data-ShowTable-3.3 installation:

cd Data-ShowTable-3.3_source_folder
perl Makefile.PL ; make ;make test; make install

During make we will get error :

Manifying blib/man3/Data::ShowTable.3
*** ERROR: unterminated I<…> at line 724 in file ShowTable.pm
*** ERROR: unterminated I<…> at line 724 in file ShowTable.pm

We need to add two brackets –  ( closing ones  > ) in line 724 in file ShowTable.pm

 

5. DBD-mysql-4.010 installation:

Change directory to DBD-mysql-4010 source folder and run commands:

perl Makefile.PL –testuser=root –testpassword=root

make
make test
make install

 

testuser and testpassword – fill according your mysql configuration

 

6. Apache 64bit installation:

 

Setup variables:

export CC=”gcc”
export CFLAGS=” -O2 -mcpu=v9 -m64″
export CPPFLAGS=” -I/usr/sfw/include”

Run configure script from source folder:

./configure –enable-mods-shared=all –enable-so

after configure:

vi Makefile

and add:

-m64 -L/usr/sfw/lib/sparcv9 -L/usr/local/lib/sparcv9 -L/usr/lib/sparcv9

in the front of PROGRAM_LDADD

Note:
– No use to set LDFLAGS when run “configure”, because -L/usr/local/lib
will be put infront of the LDFLAGS – -L/usr/sfw/lib/sparcv9 in order to find /usr/sfw/include/expat.h.

 

make
mv /usr/local/apache2  /usr/local/apache2-old
make install

export LD_LIBRARY_PATH=”/usr/local/apache2/lib:/usr/sfw/lib/sparcv9:/usr/local/lib/sparcv9:/usr/lib/sparcv9″

 

vi httpd.conf and change group to “nobody”

Then we can start Apache:

./apachectl start

 

6,5. Compilation libxml 64bit:

 

export CC=”/usr/sfw/bin/gcc -m64 -mcpu=v9″

make;make install

 

 

7. Installation PHP 64bit – version php_5.2.8

 

Setup variables :

export CC=gcc
export CFLAGS=”-m64″
export CXX=gcc
export CXXFLAGS=”-m64″
export LDFLAGS=”-m64 -L/lib/64 -L/usr/sfw/lib/64″
export LD_LIBRARY_PATH=”/usr/local/lib/sparcv9/:/usr/local/lib:/usr/local/apache2/lib:/usr/sfw/lib/sparcv9:/usr/local/lib/sparcv9:/usr/lib/sparcv9″
export LDFLAGS=”-lrt”

Run configure script from source folder:

./configure –with-apxs2=/usr/local/apache2/bin/apxs –enable-dbase \
–with-config-file-path=/etc/apache2 \
–with-mysql=/usr/local/mysql2 \
–with-mysqli=/usr/local/mysql2/bin/mysql_config \
–with-xpm-dir=/usr –with-gd –with-tiff-dir=/usr –with-bz2=/usr/lib \
–with-jpeg-dir=/usr –with-png-dir=/usr –with-zlib –enable-mbstring \
–enable-calendar–enable-bcmath –enable-ftp –enable-exif –without-iconv

Copy the file php.ini-dist from your php-5.1.6 source directory to Apache’s config directory:

cp php.ini-dist  /etc/apache2/php.ini

We want to have Apache parse the .php extension for web page file names as PHP.
Find the AddType section of your /etc/apache2/httpd.conf file, and add this line:

AddType application/x-httpd-php .php

Need more information? You didn’t find what you were looking for? Ask on our forum:

www.admindot.eu/forum

we will help.

 

Leave a Response