チラシの裏

2009 年 3 月 8 日

Solaris10にPHP5をインストールする。

カテゴリー: Solaris10 — root @ 2:01 PM

お仕事でSolaris10にPHP5をインストールすることになったので、
VMwareでインストールの練習をしてみた。
今回はグラフィック系とPostgreSQLのオプションが必要になるので
インストールする前に、いろいろパッケージを
インストールしないとPHP5のコンパイル時にエラーがでます。

●とりあえず、PHP5をいれるまえにブチ込んでおいた
ほうがよさそうなパッケージ。(余計なものもあるかも

bash-3.00# ls /opt/pkg
curl-7.19.4-sol10-x86-local libxml2-2.6.31-sol10-x86-local
expat-2.0.1-sol10-x86-local ncurses-5.6-sol10-x86-local
fontconfig-2.4.2-sol10-x86-local openssl-0.9.8j-sol10-x86-local
freetype-2.3.1-sol10-x86-local pdftk-1.12-sol10-x86-local.gz
gd-2.0.35-sol10-x86-local pngcrush-1.6.10-sol10-x86-local
jpeg-6b-sol10-intel-local postgresql-8.3.3-sol10-x86-local
libgcc-3.4.6-sol10-x86-local readline-5.2-sol10-x86-local
libidn-1.12-sol10-x86-local tiff-3.8.2-sol10-x86-local.gz
libintl-3.4.0-sol10-x86-local xmlparser-2.36-sol10-x86-local
libpng-1.2.35-sol10-x86-local xpm-3.4k-sol10-intel-local
libtool-1.5.24-sol10-x86-local zip-3.0-sol10-x86-local

パッケージはwgetを使ってsunfreewareからもらってくれば良いでしょう。

bash-3.00# cd /opt/pkg
bash-3.00# wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libpng-1.2.35-sol10-x86-local.gz
bash-3.00# gunzip libpng-1.2.35-sol10-x86-local.gz
bash-3.00# pkgadd -d libpng-1.2.35-sol10-x86-local

●gdを使うならzlibのインストールも必要です。

デフォルトで入っているgccはPATHに/usr/sfw/binを加えないと
使えないっぽい。

bash-3.00# cd /opt/src
bash-3.00# wget http://www.zlib.net/zlib-1.2.3.tar.gz
bash-3.00# gunzip -dc zlib-1.2.3.tar.gz | tar xvf -
bash-3.00# cd zlib-1.2.3
bash-3.00# configure --shared
bash-3.00# make
bash-3.00# make install

(zlibはconfigureに--sharedを付けないとダメっぽいです。

●やっとPHP5のイントール(ハァハァ
PHPの公式サイトから最新版のソースを頂いて
/opt/srcに解凍しましょう。

インストールの前にいろいろパスを設定しないと
ダメっぽいです。

bash-3.00# crle -c /var/ld/ld.config -l /usr/lib:/usr/local/lib:/usr/local/pgsql/include

まず、configureから。

bash-3.00# cd /opt/src/php-5.2.9
bash-3.00# ./configure \
--with-apxs2=/usr/apache2/bin/apxs \
--enable-track-vars \
--enable-mbstring \
--enable-mbregex \
--enable-zend-multibyte \
--with-xml \
--with-pgsql=/usr/local/pgsql \
--with-pdo-pgsql=/usr/local/pgsql \
--enable-soap \
--with-curl \
--with-gd=/usr/local \
--with-freetype-dir=/usr/local \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-zlib-dir=/usr/local \
--enable-gd-native-ttf

bash-3.00# make
bash-3.00# make install

bash-3.00# cp php.ini-dist /usr/local/lib/php.ini

bash-3.00# php -v
PHP 5.2.9 (cli) (built: Mar 8 2009 07:47:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

●apacheの設定ファイルにAddTypeを追加しましょう。

AddType application/x-httpd-php .php

●最後にapacheの再起動。

bash-3.00# svcadm restart apache2

これでOK^^

2009 年 3 月 4 日

はじめてのSolaris10

カテゴリー: Solaris10 — root @ 1:18 AM

お仕事でSolaris10を使うことになったので(‘A`)
VMware Playerに入れてお勉強をはじめました。
とりあえず、パッケージのインストールから覚えようかな(覚える順番がおかしいか?

●まず、bash
# bash

●パッケージはsunfreeware.comからダウンロードできるっぽい。
とりあえずwgetをもらう・・・
bash-3.00# mkdir /opt/pkg
bash-3.00#cd /opt/pkg ←ここでいいのか?
bash-3.00# ftp ftp.sunfreeware.com
Connected to sunfreeware.com.
220 ftp.sunfreeware.com FTP server ready.
Name (ftp.sunfreeware.com:hoge): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230-
230-==============================================
230-This is the ftp.sunfreeware.com ftp server
230-
230-If you have not already done so, make sure
230-you have read the Downloading/Installation,
230-FAQ, and Disclaimer links on
230-http://sunfreeware.com.
230-
230-This is a restricted access system. All
230-transfers are logged. If you disagree
230-with this practice, log off now.
230-
230-Questions go to Steve Christensen at
230-the address given on sunfreeware.com.
230-==============================================
230-
230-
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub/freeware/intel/10
250 CWD command successful.
ftp> get wget-1.11.4-sol10-x86-local.gz
200 PORT command successful.
150 Opening BINARY mode data connection for wget-1.11.4-sol10-x86-local.gz (871549 bytes).
226 Transfer complete.
local: wget-1.11.4-sol10-x86-local.gz remote: wget-1.11.4-sol10-x86-local.gz
871549 bytes received in 5.4 seconds (157.64 Kbytes/s)
ftp> quit
221-You have transferred 871549 bytes in 1 files.
221-Total traffic for this session was 872626 bytes in 1 transfers.
221-Thank you for using the FTP service on ftp.sunfreeware.com.
221 Goodbye.

bash-3.00# gunzip wget-1.11.4-sol10-x86-local.gz
bash-3.00# pkgadd -d wget-1.11.4-sol10-x86-local

Powered by WordPress