以前、FreeBSDのportsでphp4関連のインストールするためphp4-cgi、php4-cli、mod_php4あたをいろいろ入れてみました。しかしなぜかconfrictしあっていて同居させることができずかなり悩んだことがあります。そのとき最終的にはmod_php4を入れた後に「/usr/local/bin/php」ファイルを無理矢理作り、そのファイルをコピーして組み合わせてました。
後からわかってたんだけど、「lang/php4」を入れれば良かったらしいです。それだけで「/usr/local/libexec/apache/libphp4.so」、「/usr/local/bin/php」の両方がインストールされることがわかりました。
今回これを、正しくインストールさせようということで、いったん「pkg_delete -f mod_php4-4.4.2_1」とやってmod_php4のみ強制削除し、再度lang/php4を入れました。
ここでちょっと問題発生。
php4を入れただけではapacheモジュール(libphp4.so)がインストールされないんです。コマンドライン版のみインストールされてました。
いろいろGoogleって探しまくった結果、php4のオプション指定でapacheを有効にしてあげなくてはならなかったのです。
[lang/php4/Makefile]
OPTIONS= CLI "Build CLI version" on \
CGI "Build CGI version" on \
APACHE "Build Apache module" off \
Makefileを見るとAPACHEのデフォルトがoffに。。。
[X] CLI Build CLI version
[X] CGI Build CGI version
[X] APACHE Build Apache module
[ ] DEBUG Enable debug
[X] MULTIBYTE Enable zend multibyte support
[X] IPV6 Enable ipv6 support
[ ] REDIRECT Enable force-cgi-redirect support (CGI only)
[ ] DISCARD Enable discard-path support (CGI only)
[X] FASTCGI Enable fastcgi support (CGI only)
[X] PATHINFO Enable path-info-check support (CGI only)
[ ] OPENSSL Build static OpenSSL extension
コンパイル時のオプションで3番目のAPACHEを有効にすればlibphp4.soが入ります。
20060506:
AFFECTS: users of PHP
AUTHOR:ale@FreeBSD.org
The old PHP slave ports (phpN-cli, phpN-cgi and mod_phpN) were removed
in favour of unified PHP ports that allow building any combination of
PHP SAPIs (cli, cgi and apache module).
The PHP CGI binary was renamed to php-cgi, so you should update
the path in your script. To simplify the update process, *only* for
this release a 'php' compatibility symlink to php-cgi will be created
if you don't select the CLI SAPI.
Before the upgrade you *should* run 'make config' in lang/php4 or
lang/php5 to configure the SAPIs you want to install.
As a consequence the default binary packages include the CLI and the
FastCGI SAPIs.
しっかり、ports/UPDATINGにも書かれてますね。やっぱりしっかりドキュメントは読まないとね。