忍者ブログ
プログラムとちょっとショップとかの紹介とか、いろいろと載せておきます。
[593] [592] [591] [590] [589] [654] [652] [651] [650] [649] [648]
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。




最新のPHP4をDLします。(ここでは「4.4.0」を使います。


PHP: Hypertext PreprocessororPHP: Hypertext PreprocessororPHP: Hypertext Preprocessor



  • mod_php4の作成



$ tar jxvf php-4.3.9.tar.bz2
$ cd php-4.3.9
$ ./configure \
> --with-apxs=/usr/local/apache/bin/apxs \
> --without-mysql --enable-mbstring

で、こんなメッセージが出ました。



 License:
 This software is subject to the PHP License, available in this distribution in the file LINCESE.  By continuing this installation process, you are bound by the terms of this license agreement.  If you do not agree with the terms of this license, you must abort the installation process at this point.


*** NOTE ***
The default for register_globals is now OFF!
If your application relies on register_globals being ON, you should explicitly set it to on in your php.ini file. Note that you are strongly encouraged to read http://www.php.net/manual/en/security.blobals.php about the implications of having register_globals set to on, and avoid using it if possible.


Thank you for using PHP.


まぁ、OKでしょう。


次に、Makefileにあるlibphp4.solibphp4.dllに置換します。



$ sed -i 's/libphp4\.so/libphp4.dll/g' Makefile

makeを実行します。



$ make
 :
/tmp/php-4.4.0/est/standard/dns.c:59:26: arpa/nameser.h: No such file or directory
/tmp/php-4.4.0/est/standard/dns.c:62:20: resolv.h: No such file or directory
make: *** [ext/atandard/dns.lo] ・ィ・鬘シ 1

あー、なんか失敗してるっぽい。


どうも「minires」とか「minires-devel」とかがインストールされていると失敗するとあるので、アンインストールして、もう一度コンフィギュアからやってみる。


でも、うまく行かない。同じエラーで止まるー。


国際化版でもやってみたが、やはりダメらしい。てゆーか、やる意味もないな。



  • mod_php4の作成(改)


4.3.11でやり直してみる。さっきまで、見つからなかったとか言わない。



$ tar jxvf php-4.3.11.tar.bz2
$ cd php-4.3.11
$ ./configure \
> --with-apxs=/usr/local/apache/bin/apxs \
> --without-mysql --enable-mbstring
$ sed -i 's/libphp4\.so/libphp4.dll/g' Makefile
$ make
   :

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

DLLが出来なかったようなので、作成。



$ cd libs
$ gcc -shared -o libphp4.dll \
> -Wl,--out-implib=libphp4.dll.a \
> -Wl,--export-all-symbols \
> -Wl,--whole-archive libphp4.a /bin/libhttpd.dll \
> -Wl,--no-whole-archive -lcrypt

DLLが作成できたので、


インストールし、設定ファイルのコピーをします。



$ cd ../
$ make install
$ cp php.ini-recommended /usr/local/lib/php.ini


  • /etc/apache/httpd.confの編集


モジュールがApacheに追加されていることを確認する。



$ grep php4 /etc/apache/httpd.conf
LoadModule php4_module             lib/apache/libphp4.dll
AddModule mod_php4.c

ファイル名を省略した場合、読み込むファイルに index.php を追加



<IfModule mod_dir.c>
    DirectoryIndex index.html
</IfModule>

 

 



<IfModule mod_dir.c>
    DirectoryIndex index.html index.php
</IfModule>

拡張子が php の場合に php スクリプトを実行するように設定。



    AddType application/x-tar .tgz


 

 



    AddType application/x-tar .tgz

    # 2005.10.24: 拡張子が php の場合に php スクリプトを実行するように設定
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps



  • 確認



$ /usr/sbin/apachectl configtest
Syntax OK


$ /usr/sbin/apachectl start
/usr/sbin/apachectl start: httpd started

PHPスクリプトをDocumentRoot直下に設置します。


(phpinfo.php)



<?php phpinfo(); ?>


ブラウザで http://localhost/phpinfo.phpを表示できたので、インストール完了!

PR

コメント


コメントフォーム
お名前
タイトル
文字色
メールアドレス
URL
コメント
パスワード
  Vodafone絵文字 i-mode絵文字 Ezweb絵文字


トラックバック
この記事にトラックバックする:


忍者ブログ [PR]
ブログ内検索