LinuxにPHPをソースからインストールする

LinuxにPHPをソースからインストールする場合の手順について記載させていただきます。 ...

PHP5.2.6のダウンロード

2008年8月時点での安定版は5.2.6です。(5系の場合)

wget を使ってダウンロードするのが便利です。
ダウンロードしたら解凍します。

wget http://jp.php.net/get/php-5.2.6.tar.gz/from/this/mirror
tar xvfz php-5.2.6.tar.gz
cd php-5.2.6

インストール

configure でMakefie を作成します。この時にオプションを付けることができます。

./configure --with-apxs2=/usr/local/apache/bin/apxs 
--with-mssql --with-pgsql=/usr/local/postgres --enable-shared 
--with-calendar--with-ftp --enable-mbstring  --enable-pdf 
--enable-memory-limit --enable-ftp  --with-zlib --enable-sockets 
--enable-sysvsem

makeでソースコードをコンパイルして、インストールします。

make
sudo make install

Apacheの再起動

下記のコマンドを入力してApacheを再起動させます。(Apacheをソースからコンパイルした場合)

/usr/local/apache/bin/apachectl start

[linux,php]

投稿日:08年08月28日 17:20:17

トラックバックURL

コメントする

名前

メールアドレス

URL

コメント (HTMLは使えません)