Sun Studio 11でPHP5をコンパイル

PHP5系のコンパイル apacheのsoモジュールを作った後に、fastcgi対応版も作成。
solari10 sparc 8/07 コンパイラはSun Studio 11


コンパイラの指定
export CC=/opt/SUNWspro/bin/cc
export CXX=/opt/SUNWspro/bin/CC
export F77=/opt/SUNWspro/bin/f77
コンパイルオプションの指定
export CFLAGS=”-Xa -fast -native -xstrconst -mt -xarch=v8″
ライブラリ検索パスの追加
export LD_LIBRARY_PATH=/usr/local/lib:/lib:/usr/lib:
/usr/ucblib:/usr/sfw/lib:/opt/sfw/lib:/usr/dt/lib:
/usr/openwin/lib:/usr/xpeg4/lib:/usr/ccs/lib
(実際は一行で)
#apache1.3系のsoモジュールをインストール
通常のPHPバイナリの他に
/usr/local/apache/libexec/libphp5.so
が生成される。

#with-apxsを指定してconfig
./configure –with-apxs=/usr/local/apache/bin/apxs –with-mysql=/usr/local/mysql –enable-zend-multibyte –enable-mbstring –enable-mbregex
GDを使う場合は追加
–with-gd=/usr/local –with-jpeg-dir=/usr/ –with-png-dir=/usr –with-xpm-dir=/usr –with-freetype-dir=/usr/sfw –with-tiff-dir=/usr –with-xml=/usr –with-zlib=/usr –with-xpm-dir=/usr
#make とmake install
dmake
dmake istall

#fast-cgi版のPHPインストール
apach1.3のsoモジュールを作った後、
lighttpdなどで使用するfast-cgiで動作するバイナリを作る。
通常のPHPバイナリの他に、
/usr/local/bin/php-cgi
が生成される。

#ソースディレクトリ内の生成されたconfigとバイナリを消す
dmake distclean
#enable-fastcgiを指定してconfig
./configure –enable-fastcgi –enable-force-cgi-redirect –enable-discard-path –with-mysql=/usr/local/mysql –enable-zend-multibyte –enable-mbstring –enable-mbregex –enable-discard-path
GDを使う場合は追加
–with-gd=/usr/local –with-jpeg-dir=/usr/ –with-png-dir=/usr –with-xpm-dir=/usr –with-freetype-dir=/usr/sfw –with-tiff-dir=/usr –with-xml=/usr –with-zlib=/usr –with-xpm-dir=/usr
#make とmake install
dmake
dmake istall
(./sapi/cgi/php がcgi-phpの本体なので、
cp ./sapi/cgi/php /usr/local/bin/php-cgi
としても可)

#iniファイルのコピー
cp php.ini-dist cp php.ini-dist /usr/local/lib/php/php.ini
#後は/usr/local/lib/php/php.iniをそれらしく編集
default_charset=”UTF-8″
mbstring.language=”japanese”
とかはいるんでね?

コメントする

メールアドレスが公開されることはありません。

PAGE TOP