PHP4.4.8をソースからインストールしたときのエラーとその回避方法です。

make installしたところ、次のようなエラー(抜粋)がでました。

chmod: cannot access `/usr/local/apache2/modules/libphp4.so'

php4 apxs:Error: Command failed with rc=65536

make: *** [install-sapi] エラー 1

最初、.conigureを次のようにしていました。

./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/mysql \
--with-config-file-path=/etc/php \
--enable-mbstring \
--with-zlib \
--with-gd \
--with-libmbfl \
--enable-pcntl \
--with-openssl \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/lib \
--with-dom \
--enable-exif \
--enable-mbregex \
--without-pear \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/lib/ \
--with-gmp \
--enable-bcmath \
--enable-ftp

下記、参考リンクのページを参考に、.configureに–prefix=/usr/local/phpを指定しました。
すると、make installでエラーはでず、インストールできました。
いろいろ試したので、–prefixの指定でエラー回避となったのかどうかは、不明です。

./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/mysql \
--with-config-file-path=/etc/php \
--enable-mbstring \
--with-zlib \
--with-gd \
--with-libmbfl \
--enable-pcntl \
--with-openssl \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/lib \
--with-dom \
--enable-exif \
--enable-mbregex \
--without-pear \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/lib/ \
--with-gmp \
--enable-bcmath \
--enable-ftp

インストール環境は、VMWareのCentOS4.4です。
PHPやapacheをパッケージとしてインストールしていませんでした。

参考リンク

Tags: , ,

コメントをどうぞ