Ubuntu6.10にapache2.2.3とPHP5.2.0をソースから入れたときのメモ
普通はapt-getで入れてしまった方が楽ですがPHP5.2.0を試したかったのでソースから。apacheもついでに最新版。
ちなみにapt-cache show php5で見るとUbuntu6.10にはapt-getだとPHP5.1.6が入る。
まずはapache。
$ ./configure --enable-so checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. configure failed for srclib/apr
gccは入っていたのとconfig.logにはそれらしいエラーが見当たらなかったのとで最初なんのエラーかもわからず。ググってもちゃんとした解答がすぐには見付からなかった。
まぁ、原因はg++が入っていなかっただけで、解決しました。
$ sudo apt-get install g++ $ ./configure --enable-so $ make $ sudo make install
続いてPHP。
$ ./configure --enable-mbstring --with-apxs2=/usr/local/apache2/bin/apxs ... checking lex output file root... ./configure: 1: lex: not found configure: error: cannot find output from lex; giving up
エラーメッセージとapt-getのパッケージ名が一致しないのでapt-cache searchで探したりいろいろ。
$ sudo apt-get install flex ... configure: error: xml2-config not found. Please check your libxml2 installation.
$ sudo apt-get install libxml2-dev
あとはmake && make install。/usr/local/apache2/conf/httpd.confに
AddType application/x-httpd-php .php
を書き加えれば動く。自分は割とCLIで動かすことの方が多いですが。
JSONとか新機能を試したい。
追記:
PostgreSQL8.1.5も入れた。
sudo apt-get install libreadline5-dev
が必要だった。