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 только в одном веб-приложений, а не в глобальном масштабе.


The simplest possible configuration is described. Простейшие возможные конфигурации описана. The descriptions are terse assuming your intelligence. Описаний terse вступлением вашей разведки.

We will assume php will be installed in c:\ drive. Мы предполагаем, php будет установлена в с: \ диск. Substitute with drive letter of your choice. Замените письмо с приводом по вашему выбору.

Instructions Инструкции

  1. Download latest php 5.x zip file. Скачать последнюю php 5.x почтовый файл.
    I used Я использовал 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 .
  3. Unzip php 5.x zip file anywhere, normally c:\php Unzip php 5.x почтовый файл в любом месте, как правило, с: \ php
  4. Copy php.ini-dist, in c:\php , as php.ini Скопировать php.ini-расстояние, в с: \ 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). Выдержка php5servlet.dll из pecl почтовый файл с: \ php (Снимите флажок "Использовать имена папок" в WinZip).
    Ensure that the file is actually present in c:\php Убедитесь, что файл на самом деле присутствует в с: \ 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 Создать lib каталоге WEB-INF
  10. Create web.xml under WEB-INF with the following contents: Создать web.xml по WEB-INF со следующим содержимым:
     php  net.php.servlet  php-formatter путь к форматирования  net.php.formatter  php  *.php *. php  php-formatter путь к форматирования  *.phps *. phps 
  11. Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:\ Выдержка php5srvlt.jar и выдержка / unjar (горшок xvf…) ему в соответствии с: \
  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. Это не имеет никакой связи с именем горшок файл, который может быть что угодно.
  13. Re-create the jar file Re-создать файл горшок
  14. Copy the jar file to WEB-INF\lib directory created earlier Скопируйте файл в горшок WEB-INF \ lib каталога, созданного ранее
  15. Add c:\php to your System or User Path in Windows enironment (Hint: Right-click and select Properties from My Computer ) Добавить с: \ 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] \ бин и тип 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. Обновление: Made незначительные изменения к выделить некоторые ключевые элементы.

Solutions to common problems by users: Решения для решения общих проблем для пользователей:
Whoever is getting this error “java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path”. Тот, кто получает эту ошибку "java.lang.UnsatisfiedLinkError: нет php5servlet в java.library.path". Please check the two properties file, whether there are any blank spaces. Пожалуйста, проверьте два свойства файла, существуют ли какие-либо пробелы. I was stuck in this problem for 2 days. Я застрял на этой проблеме в течение 2 дней. There should be only one line, and no blank spaces. Там должна быть только одна строка, а не пустые пространства. Check it now!!!. Проверить это сейчас!. This is where the problem is lying. Здесь проблема лежит.
–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. Если Вы обнаружите, данное учебное пособие полезным, пожалуйста, жертвуя рассмотреть и насладиться удовольствием предоставляю.