What it solves:どのようなことを解決:

  1. Using php 5.x on Tomcat 4.x or 5.xを使用してphp 5.xのはTomcat 4.xまたは5.xの
  2. Enabling php only in one web application, instead of globally. PHPのWebアプリケーションを有効に1つだけではなく、世界的にします。


The simplest possible configuration is described.最も単純な構成が可能な説明します。 The descriptions are terse assuming your intelligence.その説明は簡潔な知性と仮定しています。

We will assume php will be installed in c:\ drive.我々はPHPのがインストールされることを想定ではC : \ドライブに挿入します。 Substitute with drive letter of your choice.代わりにドライブ文字を選択します。

Instructions 指示

  1. Download latest php 5.x zip file.最新のphp 5.xのzipファイルをダウンロードします。
    I used私使用される http://www.php.net/get/php-5.0.2-Win32.zip/from/a/mirror http://www.php.net/get/php-5.0.2-win32.zip/from/a/mirror .です。
  2. Download latest Collection of PECL modules.最新のコレクションのPECLモジュールをダウンロードします。 I used私使用される http://www.php.net/get/pecl-5.0.2-Win32.zip/from/a/mirror http://www.php.net/get/pecl-5.0.2-win32.zip/from/a/mirror .です。
  3. Unzip php 5.x zip file anywhere, normally c:\php zipファイルを解凍php 5.xのどこからでも、通常はc : \ PHPの
  4. Copy php.ini-dist, in c:\php , as php.iniコピーのphp.ini - distを、ではC : \ PHPのphp.iniの
  5. Uncomment the line (remove semi-colon at the beginning) in php.ini:行のコメントを外して(削除の冒頭にセミコロン) php.iniの:
    ;extension=php_java.dll ;拡張子= php_java.dll
  6. Extract php5servlet.dll from pecl zip file to c:\php (Uncheck "Use Folder Names" in WinZip). peclの ZIPファイルからの抽出物にphp5servlet.dllc : \ PHPの (チェックボックスをオフに"フォルダの名前を使用"をWinZipなど) 。
    Ensure that the file is actually present in c:\php確保されているファイルは、実際に現在ではC : \ PHPの
  7. Install Tomcat and create a directory under webapps. Tomcatのインストールディレクトリを作成するとされてwebappsか。 Lets say it is named fun .言ってやることが楽しいという名前を使用します。
  8. Create WEB-INF directory under fun WEB - INFディレクトリ作成されて楽しい
  9. Create lib directory under WEB-INF WEB - INFのlibディレクトリに作成されて
  10. Create web.xml under WEB-INF with the following contents: WEB - INFのweb.xmlに作成されては、次の内容:
     php PHPの  net.php.servlet  php-formatterでPHP -フォーマッタ  net.php.formatter  php PHPの  *.php *. PHPの  php-formatterでPHP -フォーマッタ  *.phps *. phps 
  11. Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:\エキスphp5srvlt.jarおよびエキス/ unjar -(瓶のx vf… )とされてc : \
  12. Modify both the files reflect.properties and servlet.properties to change the line library=phpsrvlt to library=php5servlet and save them.変更の両方のファイルの行を変更するにreflect.propertiesおよびservlet.properties ライブラリ= phpsrvltライブラリ= php5servlet無しして保存する。 This indicates the file name of the dll file which is loaded by the Java application to serve the requests.これは、ファイル名のdllファイルが読み込まれるJavaアプリケーションの要求に奉仕する。 In my version the name of the dll was php5servlet.dll .私の名前は、 DLLのバージョンを指定するにphp5servlet.dllがします。 Your mileage may vary.お客様の走行距離は異なる場合があります。 This has no connection with the name of the jar file which can be anything.この接続ではないのjarファイルの名前を何かができる。
  13. Re-create the jar file jarファイルを再作成する
  14. Copy the jar file to WEB-INF\lib directory created earlier jarファイルをコピーしてウェブ- INF \ libにディレクトリを作成した
  15. Add c:\php to your System or User Path in Windows enironment (Hint: Right-click and select Properties from My Computer ) cを加えなさい: \ PHPをお使いのシステムまたはユーザのパスをWindows enironment (ヒント:右クリックし、 [プロパティ]から[マイコンピュータ]
  16. Create a file test.php under fun with the following code:ファイルを作成し、 test.phpを楽しみにされては、次のコード:

  17. Start Tomcat (Go to [Tomcat installation directory]\bin and type Tomcat).スタート]ボタンをTomcatの(全個体を[ Tomcatのインストールディレクトリ] \ binとタイプのTomcat ) 。
  18. Open your browser and go to http://localhost:8080/fun/test.phpお使いのブラウザを開いて行くhttp://localhost:8080/fun/test.php
  19. Ensure that there are no errors displayed.のエラーが表示されていないことを確認します。 Instead you get an informative screen with php version information and whole lot of details情報を取得する代わりに画面全体にPHPのバージョン情報とたくさんの詳細

Let me know if this document is helpful to you.させてこの文書には役に立ちましたかどうかです。

Update: Made minor revision to highlight some key elements.更新プログラム:小規模改訂はいくつかの重要な要素を強調します。

Solutions to common problems by users: 共通の問題を解決策をご利用の場合:
Whoever is getting this error “java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path”.誰でもこのエラーは、就学許可証" java.lang.unsatisfiedlinkerror : java.library.pathのphp5servlet無し"です。 Please check the two properties file, whether there are any blank spaces. 2つのプロパティを確認してくださいファイルを、任意の空白スペースがあるかどうかです。 I was stuck in this problem for 2 days.私はこの問題を回避するため2日間で身動きが取れない。 There should be only one line, and no blank spaces. 1つだけ存在する必要があります行を空白スペースがない。 Check it now!!!.今すぐチェック!です。 This is where the problem is lying.これは、どこに問題が横たわっています。
–Arundhati - arundhati

The versions of php and pecl must be the same.ののバージョンのPHPおよびPECLは同じでなければなりません。
–Mirek Mocek -ミレックmocek

You might want to add a reboot step at the end of your instructions.をお勧めしますステップを追加するには、最後に再起動して指示に従います。 It would eliminate a lot of the problems with the unsatisfied link errors.それは多くの問題を排除するの不満足なリンクエラーが発生します。
– Chuck Rosendahl -チャックローゼンダール

Note: 注記:
If you find this tutorial useful, please consider donating and enjoy the pleasure of giving.このチュートリアルが見つかった場合は便利ですが、ご検討の喜びを与える寄付し、お楽しみです。