What it solves: ما يحل :

  1. Using php 5.x on Tomcat 4.x or 5.x بي. اتش. بى باستخدام 5.x على 4.x قط أو 5.x
  2. Enabling php only in one web application, instead of globally. بي. اتش. بى تمكن فقط في تطبيق واحد على الشبكه العالمية ، بدلا من الصعيد العالمي.


The simplest possible configuration is described. بأبسط ما يمكن وصفها التكوين. The descriptions are terse assuming your intelligence. وقد وصف مقتضب على افتراض الاستخبارات الخاصة بك.

We will assume php will be installed in c:\ drive. ونحن ستتولى بي. اتش. بى وسيتم تركيبها في ج : \ محرك الأقراص. Substitute with drive letter of your choice. بديل مع حملة رسالة من اختيارك.

Instructions تعليمات

  1. Download latest php 5.x zip file. بي. اتش. بى 5.x آخر تحميل ملف مضغوط.
    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 Unzip بي. اتش. بى 5.x ملف مضغوط في اي مكان ، عادة ج : \ بي. اتش. بى
  4. Copy php.ini-dist, in c:\php , as php.ini نسخة php.ini - Distr ، في ج : \ بي. اتش. بى ، كما 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 ج : \ بي. اتش. بى (أزل "استخدام اسماء مجلدات" فى برنامج لضغط الملفات).
    Ensure that the file is actually present in c:\php ضمان ان الملف هو موجود فعليا في ج : \ بي. اتش. بى
  7. Install Tomcat and create a directory under webapps. تثبيت قط ووضع دليل تحت webapps. Lets say it is named fun . يتيح القول انه اسمه المرح.
  8. Create WEB-INF directory under fun انشاء شبكة الانترنت في اطار الوقود النووي المشع دليل المرح
  9. Create lib directory under WEB-INF إنشاء مكتبة دليل على شبكة الانترنت في اطار الوقود النووي المشع
  10. Create web.xml under WEB-INF with the following contents: انشاء شبكة الانترنت في اطار web.xml الوقود النووي المشع مع المحتويات التالية :
     php بي. اتش. بى  net.php.servlet  php-formatter بي. اتش. بى - formatter  net.php.formatter  php بي. اتش. بى  *.php بي. اتش. بى *.  php-formatter بي. اتش. بى - 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 الذي يحمل كثيرا من تطبيق جافا لخدمة الطلبات. In my version the name of the dll was php5servlet.dll . في بلادي نسخة من اسم كان php5servlet.dll 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 - اعادة تهيئة الملف جرة
  14. Copy the jar file to WEB-INF\lib directory created earlier نسخة الجره الملف على شبكة الانترنت الوقود النووي المشع \ مكتبة انشئت في وقت سابق من دليل
  15. Add c:\php to your System or User Path in Windows enironment (Hint: Right-click and select Properties from My Computer ) اضافة ج : \ بي. اتش. بى أو الى النظام المستخدم في ويندوز الطريق 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). تبدأ قط (اذهب الى [قط تركيب دليل] \ بن ونوع قط).
  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 وبدلا من حصولك على الشاشه مع اعلامي على معلومات حول اصدار بي. اتش. بى وكله الكثير من التفاصيل

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 : لا 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. نسخ pecl بي. اتش. بى ويجب ان تكون واحدة.
–Mirek Mocek - Mirek 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 -- تشوك Rosendahl -

Note: ملاحظه :
If you find this tutorial useful, please consider donating and enjoy the pleasure of giving. اذا وجدت هذه الدورة التعليميه مفيدة ، يرجى ان تنظر في منح والتمتع يسرني ان من العطاء.