Running php 5.x on windows using tomcat 4.x or 5.x運行PHP 5.x的對Windows中使用的Tomcat 4.x或5.x的
What it solves:它解決了:
- Using php 5.x on Tomcat 4.x or 5.x使用PHP 5.x的關於Tomcat和4.x或5.x的
- Enabling php only in one web application, instead of globally.使PHP的,只有在一個Web應用程序,而不是全球。
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 指示
- 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 . 。 - 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 . 。
- Unzip php 5.x zip file anywhere, normally c:\php解壓縮的PHP 5.x的zip檔案的任何地方,通常是將C : \ php
- Copy php.ini-dist, in c:\php , as php.ini複製包中將php.ini - dist ,在C : \ PHP中 ,作為在php.ini
- Uncomment the line (remove semi-colon at the beginning) in php.ini:註釋線(移除半結腸在開始時)在php.ini :
;extension=php_java.dll ;擴展= php_java.dll - Extract php5servlet.dll from pecl zip file to c:\php (Uncheck "Use Folder Names" in WinZip).提取php5servlet.dll從的PECL zip檔案到C : \的PHP (取消勾選“使用文件夾名稱”在WinZip的) 。
Ensure that the file is actually present in c:\php確保該文件其實是目前在C : \的PHP - Install Tomcat and create a directory under webapps.安裝的Tomcat和創建一個目錄下的webapps 。 Lets say it is named fun .可以說這是命名為樂趣 。
- Create WEB-INF directory under fun創建Web - INF目錄下的樂趣
- Create lib directory under WEB-INF創建庫目錄下的Web -干擾素
- Create web.xml under WEB-INF with the following contents:創建web.xml下的Web -干擾素具有下列內容:
php PHP的 net.php.servlet php-formatter PHP的-格式化 net.php.formatter php PHP的 *.php *.的PHP php-formatter PHP的-格式化 *.phps *. phps - Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:\ php5srvlt.jar提取物和提取物/ unjar (罐xvf … … ) ,它在C : \
- 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文件可以任何事情。
- Re-create the jar file重新創建JAR文件
- Copy the jar file to WEB-INF\lib directory created earlier複製jar文件到Web -干擾素\庫目錄先前創建的
- 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 (提示:點擊右鍵並選擇屬性從我的電腦 )
- Create a file test.php under fun with the following code:創建一個文件test.php下的樂趣與以下代碼:
- Start Tomcat (Go to [Tomcat installation directory]\bin and type Tomcat).開始的Tomcat (去[的Tomcat安裝目錄] \斌和類型的Tomcat ) 。
- Open your browser and go to http://localhost:8080/fun/test.php打開瀏覽器並轉到http://localhost:8080/fun/test.php
- 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 :沒有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 - Arundhati -使Arundhati
The versions of php and pecl must be the same.該版本的PHP和的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 -夾頭r osendahl
Note: 注意:
If you find this tutorial useful, please consider donating and enjoy the pleasure of giving.如果您發現本教程有用,請考慮捐贈和享受的樂趣,讓。
Filed under提起下 Headline News頭條新聞 , , How To如何 , , Java Software Java軟件 , , PHP PHP的 , , Technology技術 , , Web網頁 , , Web Services Web服務 | |
| |
RSS 2.0 2.0 | |
Trackback Trackback跟踪 this Article |此文章|
Email this Article電子郵件此文章
You may also like to read您也可以想讀 |
The comments are currently closed for this post.評論正在關閉這個職位。



Add to Technorati Favorites 

December 20th, 2004 at 8:41 am 2004年12月20日在上午8時41分
I tried this b4 (http://analogueboy.blogspot.com/#106959689637832829) but it wasn’t very reliable.我想這三烯B4 ( http://analogueboy.blogspot.com/編號106959689637832829 ) ,但它並不十分可靠。 I tried to run phpbb under tomcat and it repeated failed.我嘗試運行phpbb下的Tomcat和它一再失敗。 Have you found the process to be more reliable under php5?你發現的過程中要更可靠的根據php5 ?
December 20th, 2004 at 1:27 pm 2004年12月20日在下午1時27分
The system was stable so long you didn’t have to reload the web application.該系統是穩定的,只要你沒有重新加載Web應用程序。 In the given installation scenario the jar which loaded the native dll is loaded from the web application context.在特定情況下安裝的JAR ,其中裝貨本土的DLL加載從Web應用程序上下文。 So re-loading web application causes problem.因此,重新載入Web應用程序的成因問題。 It is better to restart Tomcat.最好是重新啟動的Tomcat 。 However I presume that will be gone if the jar is moved to common/lib.不過,我假定將會消失,如果罐子轉移到共同/ lib目錄中。
December 28th, 2004 at 7:43 am 2004年12月28日在上午07時43分
im getting this error即時通訊收到這個錯誤
javax.servlet.ServletException: Servlet execution threw an exception javax.servlet.servletexception : Servlet的執行投擲一個例外
root cause的根源
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
net.php.servlet.send(Native Method) net.php.servlet.send ( native方法)
net.php.servlet.service(servlet.java:190) net.php.servlet.service ( servlet.java : 190 )
net.php.servlet.service(servlet.java:214) net.php.servlet.service ( servlet.java : 214 )
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) javax.servlet.http.httpservlet.service ( httpservlet.java : 802 )
December 30th, 2004 at 2:20 am 2004年12月30日在上午02時20分
# Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:\ #提取php5srvlt.jar和提取物/ unjar (罐xvf … … ) ,它在C : \
WHAT DO YOU MEAN BY THIS LIGNE是什麼意思,這ligne
# 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 ,並將它們保存
HERE I CAN’T FIND REFLET AND SERVLET.PROPERTIES?在這裡,我無法找到reflet和servlet.properties ?
# Re-create the jar file #重新創建JAR文件
HERE ALSO WITCH FILE在這裡還巫婆檔案
# Copy the jar file to WEB-INF\lib directory created earlier #複製JAR文件到Web -干擾素\庫目錄先前創建的
# Add c:\php to your System/User Path in Windows enironment (Hint: Right-click and select Properties from My Computer) #添加將C : \ php到您的系統/用戶路徑在Windows enironment (提示:點擊右鍵並選擇屬性從我的電腦)
# Create a file test.php under fun with the following code: #創建一個文件test.php下的樂趣與以下代碼:
< ?php phpinfo(); ?> < ? PHP的phpinfo ( ) ; ? >
# Start Tomcat (Go to [Tomcat installation directory]\bin and type Tomcat). #開始的Tomcat (去[的Tomcat安裝目錄] \斌和類型的Tomcat ) 。
# Open your browser and go to #打開瀏覽器並轉到 http://localhost:8080/fun/test.php
# Ensure that there are no errors displayed. #確保有沒有錯誤顯示。 Instead you get an informative screen with php version information and whole lot of details不是你得到一個翔實的屏幕上用PHP的版本信息和整個很多細節
I FIND THIS IN INTERNET = IT DOESN’我覺得這是在Internet =它不'
T WORK科技工作
the php5 version of phpsrvlt.jar is not working correctly because of a該php5版本的phpsrvlt.jar工作不正常,因為一個
mistake in錯誤的
net\php\reflect.properties淨\ PHP中\ reflect.properties
and和
net\php\servlet.properties淨\ PHP中\ servlet.properties
there’s one space after the library name that should be stripped.有一個空間後,圖書館的名稱應被剝奪。
after doing this i’ve no problem using php5 out of an java appserver.這樣做之後我已經沒有問題,使用php5走出一華appserver 。
mfg, mfg ,脂,
28 Oct 1:30pm CEST] MerlinDMC at t-online dot de 10月28日下午1時30 cest ] merlindmc在T - Online的斑點德
CAN YOU HELP ME PLEASE你能幫助我,請
December 30th, 2004 at 2:30 am 2004年12月30日凌晨2時30分
Etat HTTP 500 -國務出現HTTP 500 -
——————————————————————————– ---------------------------
type Rapport d’exception類型融洽的例外-
message訊息
description Le serveur a rencontré une erreur interne () qui l’a empêché de satisfaire la requête.描述樂serveur一rencontré une erreur網際網路( ) qui l'一empêché德satisfaire香格里拉requête 。
exception例外
javax.servlet.ServletException: L’exécution de la servlet a lancé une exception javax.servlet.servletexception : l' exécution德香格里拉Servlet的一lancé une例外
cause mère事業mère
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
net.php.servlet.send(Native Method) net.php.servlet.send ( native方法)
net.php.servlet.service(servlet.java:190) net.php.servlet.service ( servlet.java : 190 )
net.php.servlet.service(servlet.java:214) net.php.servlet.service ( servlet.java : 214 )
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) javax.servlet.http.httpservlet.service ( httpservlet.java : 853 )
note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/5.5.6.注意:香格里拉微量complète德香格里拉事業mère德這一erreur預測disponible dans本港就業輔導組fichiers journaux德阿帕奇tomcat/5.5.6 。
January 2nd, 2005 at 2:59 pm 2005年1月2日在下午2時59分
I don’t understand Spanish.我不明白,西班牙語。 However I believe the content of the two comments above are the same - UnsatisfiedLinkError.不過我相信的內容,這兩個上述評論是相同的-u nsatisfiedlinkerror。
As the jar file is placed under web-inf/lib directory realoding the web container causes the dll to be reloaded again which fails.作為JAR文件是置於web-inf/lib目錄realoding該Web容器的原因DLL文件,以重新載入,這再次失敗。
The simplest solution is to restart the server whenever there is a need to restart the web conatiner.最簡單的解決方法是重新啟動服務器,每當有需要,以重新啟動Web conatiner 。 However to eliminate the problem totally you can place the jar under common/lib directory.不過,以消除問題,完全可以放在罐子下,共同/ lib目錄中的目錄。 That way it is loaded the tomcat classloader and is not restarted when the web container is restarted.這種方式,這是裝貨的Tomcat的類是沒有重新啟動時, Web容器是重新啟動。
Let me know if that helps.讓我知道,如果有幫助。
January 2nd, 2005 at 3:05 pm 2005年1月2日在下午3時05分
Bill> the php5 version of phpsrvlt.jar is not working correctly because of a mistake in net\php\reflect.properties and net\php\servlet.properties.條例草案> “ php5版本的phpsrvlt.jar工作不正常,因為一個錯誤的淨\ PHP中\ reflect.properties和淨\ PHP中\ servlet.properties 。 There’s one space after the library name that should be stripped.有一個空間後,圖書館的名稱應被剝奪。 After doing this i’ve no problem using php5 out of an java appserver.這樣做之後我已經沒有問題,使用php5走出一華appserver 。
The problem has been addressed in steps 11-13 above (quoted below for convenience):該問題已解決的步驟, 11月13日以上(引述下面為方便起見) :
11. 11 。 Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:\ php5srvlt.jar提取物和提取物/ unjar (罐xvf … … ) ,它在C : \
12. 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 ,並將它們保存
13. 13 。 Re-create the jar file重新創建JAR文件
January 16th, 2005 at 2:48 am 2005年1月16日在上午02時48分
Hi.嗨。 I followed all the steps with no problem.我在所有的步驟,與沒有問題。 The only difference was at step 11 (”Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:”).唯一的分別是在第11步( “提取php5srvlt.jar和提取物/ unjar (罐xvf … … ) C :下” ) 。 Extract from where?提取物在哪裡? I suppose it’s located in PECL zip file.我想它位於城市裡的的PECL zip檔案。 There was only “phpsrvlt.jar” so I used that instead.目前只有“ phpsrvlt.jar ”所以我認為與其用。 Everything else was fine.一切是好的。
Now step 19: on the first page request from the browser I get following error:現在步驟19 :在第一頁上的要求,從瀏覽器中我得到以下錯誤:
java.lang.IllegalAccessError: tried to access method net.php.reflect.loadLibrary(Ljava/lang/String;)V from class net.php.servlet java.lang.illegalaccesserror :試圖訪問的方法net.php.reflect.loadlibrary ( ljava /郎/字符串; ) v從階級net.php.servlet
net.php.servlet.init(servlet.java:157) net.php.servlet.init ( servlet.java : 157 )
[snipped] [ snipped ] [絲帶]
…every other page request results in this error: …每一個其他網頁的要求,結果在此錯誤:
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
net.php.servlet.send(Native Method) net.php.servlet.send ( native方法)
net.php.servlet.service(servlet.java:190) net.php.servlet.service ( servlet.java : 190 )
net.php.servlet.service(servlet.java:214) net.php.servlet.service ( servlet.java : 214 )
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) javax.servlet.http.httpservlet.service ( httpservlet.java : 802 )
I’m pretty sure I did all your steps, so where could be the problem?!我相當肯定我您的所有步驟,那麼可能是問題嗎! I’m using Tomcat 5.5.4 and PHP 5.0.3…我使用的Tomcat 5.5.4和PHP 5.0.3 …
Thanks in advance for your help.謝謝您的幫助。
January 16th, 2005 at 4:08 am 2005年1月16日在上午04時08分
Lukas> The only difference was at step 11 (”Extract php5srvlt.jar and extract/unjar (jar xvf …) it under c:”).盧卡斯> “唯一的分別是在第11步( ”提取php5srvlt.jar和提取物/ unjar (罐xvf … … ) C :下“ ) 。 Extract from where?提取物在哪裡? I suppose it’s located in PECL zip file.我想它位於城市裡的的PECL zip檔案。 There was only “phpsrvlt.jar” so I used that instead.目前只有“ phpsrvlt.jar ”所以我認為與其用。 Everything else was fine.一切是好的。
Angsuman> I meant extract the contents of phpsrvlt.jar.由Angsuman >我的意思的內容提取phpsrvlt.jar 。 The idea is to change the content of the two properties file within the jar file.想法是要改變的內容,這兩個屬性文件內部的JAR文件。 And yes you will get the jar file in pecl.zip.和是你會得到JAR文件在pecl.zip 。
Lukas>Now step 19: on the first page request from the browser I get following error盧卡斯>現在步驟19 :在第一頁上的要求,從瀏覽器中我得到以下錯誤
Angsuman> Please make the changes and let me know if you still face the problem.由Angsuman >請的變化和讓我知道,如果你仍然要面對的問題。
January 18th, 2005 at 4:15 pm 2005年1月18日在下午4時15分
Hi.嗨。 I’m using Tomcat 5.5.4 with PHP 5.03.我使用的Tomcat 5.5.4用PHP 5.03 。 I’ve followed all the instuctions above and got to step 19.我已經照著所有的instuctions以上得到加強19 。 When I go to當我去 http://localhost:8080/fun/test.php I get a blank screen.我碰到一個空白畫面。 When I look at the source, it contains < ?php phpinfo(); ?> It appears that Tomcat is loading the test.php file but the php script is not running.當我看到的來源,它包含了< ? PHP的phpinfo ( ) ; ? >看來,雄貓正在載入test.php文件,但PHP腳本沒有運行。 I’ve tried this with and without the extra spaces in reflect.properties and servlet.properties and get the same behavior.我試過,這和沒有多餘的空格在reflect.properties和servlet.properties ,並得到相同的行為。 Thanks for your help!感謝您的幫助!
January 18th, 2005 at 4:33 pm 2005年1月18日在下午4時33分
Hi.嗨。 That last message was supposed to say “it contains phpinfo();” but the website didn’t like the LT/GT ?去年的訊息是假定說: “它包含phpinfo ( ) ; ” ,但該網站不喜歡審裁處/ GT的?
January 23rd, 2005 at 4:23 am 2005年1月23日在上午04時23分
Finally got it working!終於,它的工作! The problem was in my classpath setup.問題是,在我的classpath下安裝。 I got two different php_java.jar files accessible through classpath and Java was all confused with it (that’s why I was still getting this java.lang.IllegalAccessError)…我得到兩個不同的php_java.jar文件可通過類和Java是所有混亂與它(這就是為什麼我仍是獲得這java.lang.illegalaccesserror ) … …
Now I’m wondering if there’sa way to call Java code within the servlet’s JVM from the actual PHP code.現在,我想如果有辦法調用Java代碼內部的Servlet的JVM的從實際的PHP代碼。 To be more specific: I need to create Java singleton in PHP code and share this singleton within all server PHP-requests (I tried PHP - Java integration using PHP object Java [ie. < ?php $i = new Java('java.lang.Integer'); ?>] but PHP interpretter was starting extra JVM for each single page it interpretted).為了更具體:我需要創建的Java單身在PHP代碼和分享此單身內所有服務器的PHP -請求(我嘗試的PHP -J ava的整合使用P HP對象的J ava[即< ? P HP的美元=新的J ava(爪哇。 lang.integer ' ) ; ? > “但是PHP interpretter開始額外的JVM為每個單頁,它interpretted ) 。 Any ideas?任何想法? Thanks…感謝…
January 23rd, 2005 at 3:54 pm 2005年1月23日在下午3時54分
Lukas> Now I’m wondering if there’sa way to call Java code within the servlet’s JVM from the actual PHP code.盧卡斯>現在,我想如果有辦法調用Java代碼內部的Servlet的JVM的從實際的PHP代碼。 To be more specific: I need to create Java singleton in PHP code and share this singleton within all server PHP-requests (I tried PHP - Java integration using PHP object Java [ie. ] but PHP interpretter was starting extra JVM for each single page it interpretted).為了更具體:我需要創建的Java單身在PHP代碼和分享此單身內所有服務器的PHP -請求(我嘗試的PHP -J ava的整合使用P HP對象的J ava[即。 ]但是P HPi nterpretter開始額外的J VM為每個單頁它interpretted ) 。 Any ideas?任何想法? Thanks…感謝…
There is a simple way and there is a complicated way有一個簡單的方式是有複雜的方式
The simple way would be to write a jsp page which contains the desired code and load the page from php code.簡單的方式,將寫一JSP的網頁,其中包含所期望的代碼並載入網頁,由PHP代碼。
January 23rd, 2005 at 3:55 pm 2005年1月23日在下午3時55分
Brian> Hi.布賴恩>喜。 I’m using Tomcat 5.5.4 with PHP 5.03.我使用的Tomcat 5.5.4用PHP 5.03 。 I’ve followed all the instuctions above and got to step 19.我已經照著所有的instuctions以上得到加強19 。 When I go to當我去 http://localhost:8080/fun/test.php I get a blank screen.我碰到一個空白畫面。 When I look at the source, it contains It appears that Tomcat is loading the test.php file but the php script is not running.當我看到的來源,它包含看來,雄貓正在載入test.php文件,但PHP腳本沒有運行。 I’ve tried this with and without the extra spaces in reflect.properties and servlet.properties and get the same behavior.我試過,這和沒有多餘的空格在reflect.properties和servlet.properties ,並得到相同的行為。 Thanks for your help!感謝您的幫助!
Brian,布賴恩,
I think you missed step 10.我認為你錯過了第10步。 That creates the mapping between .php file and the servlet.創建之間的映射。 PHP文件和Servlet的。
Please check and let me know.請檢查並讓我知道。
January 24th, 2005 at 12:39 am 2005年1月24日在上午12時39分
Angsuman> I tried repeating step 10 again, assuming I made a mistake, but was still unable to get this to work.由Angsuman >我試圖重複第10步再次,假設我犯了個錯誤,但仍無法得到這個工作。 Is the php5srvlt.jar supposed to be in the C:/php directory as well, or just the WEB-INF/lib?是php5srvlt.jar是為了在C : / PHP目錄,以及,或只web-inf/lib ? When I recreate the jar, does it suffice to edit the reflect.properties and servlet.properties files and overwrite the files in the jar or do I need to use the java command to rebuild the jar???當我重新罐子,是否足以編輯reflect.properties和servlet.properties文件和覆蓋的文件在罐子或我需要使用Java命令重建罐子? ? ?
This is what my directory structure looks like:這是我的目錄結構看起來就像這樣:
webapps/fun/ webapps /娛樂/
test.php
WEB-INF/網絡-干擾素/
/lib / lib目錄
web.xml
php5srvlt.jar
Thanks again!再次感謝!
January 24th, 2005 at 1:36 am 2005年1月24日在上午01時36分
Brian> I tried repeating step 10 again, assuming I made a mistake, but was still unable to get this to work.布賴恩>我試圖重複第10步再次,假設我犯了個錯誤,但仍無法得到這個工作。
Angsuman> Any errors in tomcat log files?由Angsuman >的任何錯誤在Tomcat日誌文件?
Brian> Is the php5srvlt.jar supposed to be in the C:/php directory as well, or just the WEB-INF/lib?布賴恩>是php5srvlt.jar是為了在C : / PHP目錄,以及,或只web-inf/lib ?
Angsuman> Just WEB-INF/lib should be fine.由Angsuman >剛剛web-inf/lib應罰款。
Brian> When I recreate the jar, does it suffice to edit the reflect.properties and servlet.properties files and overwrite the files in the jar or do I need to use the java command to rebuild the jar???布賴恩> ,當我重新罐子,是否足以編輯reflect.properties和servlet.properties文件和覆蓋的文件在罐子或我需要使用Java命令重建罐子? ? ?
Angsuman> I am not sure I understand.由Angsuman > ,我不知道我明白。 You need to unjar the files, modify them and then rebuild the jar and deploy the new jar file.您需要unjar檔案,對它們進行修改,然後重建JAR和部署新的JAR文件。 Verify it by checking that the files have actually been changed and that the path information of the files is identical to the original.核實檢查檔案,其實已改變,並認為路徑信息的文件是相同的原。 The steps given, if followed to the dot should ensure that.步驟給予,如果跟踪到斑點應確保。
Brian> This is what my directory structure looks like:布賴恩> ,這是我的目錄結構看起來就像這樣:
webapps/fun/ webapps /娛樂/
test.php
WEB-INF/網絡-干擾素/
/lib / lib目錄
web.xml
php5srvlt.jar
Angsuman> The directory structure is not clear from this comment.由Angsuman > “目錄結構不明確,從這個評論。 The php file should be under fun. PHP的文件應根據樂趣。 WEB-INF/web.xml, WEB-INF/lib/*.jar should be the normal order of files. web-inf/web.xml , web-inf/lib / *.罐應正常秩序的文件。
Specifically web.xml should be under WEB-INF directory and not under lib.具體web.xml應根據網絡的INF目錄,而不是根據庫。
Hope that clarifies…希望澄清…
January 24th, 2005 at 3:47 pm 2005年1月24日在下午3時47分
Well, I have a weird problem.好,我有一個奇怪的問題。 Everything is set up, but I get this exception about gibberish:一切都成立,但我得到這個例外約無用:
java.io.IOException: °?ü °?ü ¸?ü ¤Cü ü>– java.io.ioexception : ° ? ü ° ? ü ¸ ? ü ¤ cü ü > -
at net.php.servlet.send(Native Method)在net.php.servlet.send ( native方法)
at net.php.servlet.service(servlet.java:190)在net.php.servlet.service ( servlet.java : 190 )
[snipped] [ snipped ] [絲帶]
Do let me know if you have any information on this.這樣做讓我知道,如果您有任何這方面的資料。
Thanks,謝謝,
Sachin分析師
January 24th, 2005 at 4:15 pm 2005年1月24日在下午4時15分
Sorry for a hasty post previously, that problem is solved.對不起,太急,郵政以前,這個問題是解決。 I do have another problem, but I haven’t started working on solving it yet.我有另一個問題,但我還沒有開始工作就解決它。 Its about a fairly complex php page not displaying properly.其約一個相當複雜的PHP頁面不能正確顯示。 Will post more on that in case I can’t solve it.會後更在這情況下,我不能解決這個問題。 Once again, sorry for the big (and useless) post above.再次,對不起為大(無用)郵政以上。
Thanks,謝謝,
Sachin分析師
January 24th, 2005 at 4:20 pm 2005年1月24日在下午4時20分
No problem!沒問題! Let me know how it gies Sachin.讓我知道如何gies分析師。 Do share if you have found something new.這樣做的份額如果您有一些新的發現。
January 24th, 2005 at 11:57 pm 2005年1月24日在下午11時57分
I am receiving a similar error to what Sachin was getting and was wondering what the solution to that was?我收到了類似的錯誤,以什麼分析師越來越被懷疑有什麼解決辦法,這是? The first time I try to lead the page I am getting this error:是我第一次嘗試導致網頁,我收到這個錯誤:
javax.servlet.ServletException: Servlet.init() for servlet php threw exception javax.servlet.servletexception : servlet.init ( )為Servlet的PHP的投擲例外
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.valves.errorreportvalve.invoke ( errorreportvalve.java : 105 )
[snipped] [ snipped ] [絲帶]
root cause的根源
java.lang.UnsatisfiedLinkError: no php5srvlt in java.library.path java.lang.unsatisfiedlinkerror :沒有php5srvlt在java.library.path
java.lang.ClassLoader.loadLibrary(Unknown Source) java.lang.classloader.loadlibrary (來源不明)
[snipped] [ snipped ] [絲帶]
When I reload the page I get this error:當我重新載入網頁我收到此錯誤:
javax.servlet.ServletException: Servlet execution threw an exception javax.servlet.servletexception : Servlet的執行投擲一個例外
root cause的根源
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
net.php.servlet.send(Native Method) net.php.servlet.send ( native方法)
net.php.servlet.service(servlet.java:190) net.php.servlet.service ( servlet.java : 190 )
net.php.servlet.service(servlet.java:214) net.php.servlet.service ( servlet.java : 214 )
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) javax.servlet.http.httpservlet.service ( httpservlet.java : 802 )
Thanks for the help!感謝您的幫助!
January 25th, 2005 at 2:20 pm 2005年1月25日在下午2時20分
Brian,布賴恩,
Is php5srvlt.jar file under WEB-INF\lib directory?是php5srvlt.jar文件在Web -干擾素\庫的目錄中?
Please restart tomcat and let me know if the problem persists.請重新啟動的Tomcat和讓我知道,如果問題仍然存在。
Angsuman由Angsuman
January 25th, 2005 at 2:30 pm 2005年1月25日下午2時30分
BTW: Made a small update to the post to clarify that web.xml should be placed under WEB-INF directory.的BTW :發了言小更新後,以澄清web.xml應放在下Web的INF目錄。 I previously assumed everyone knows that due to previous experience with servlets.我先前假設大家都知道,由於以往的經驗與/ Servlets 。
January 25th, 2005 at 7:14 pm 2005年1月25日在下午7點14分
sorry….對不起… … 。 nooobie here, How to Rebuild jar file ? nooobie在這裡,如何重建JAR文件?
January 25th, 2005 at 7:53 pm 2005年1月25日在下午7點53分
ok to unjar -> “jar xfv phpsrvlt.jar”確定以unjar -> “ ”罐子x fvp hpsrvlt.jar“
to Recreate the jar file -> “jar cvf php5srvlt.jar net/php/*.*重新jar文件-> “ ”罐子c vfp hp5srvlt.jar網/ P HP中/ * .*
done this and pasted the newly created jar file into c:\php and fun\WEB-INF這樣做,並粘貼新創建的JAR文件到C : \ PHP和樂趣\網站-干擾素
but apparently my Tomcat root seems to be the webapps\ROOT folder, n not just Webapps..但顯然我的Tomcat根似乎成為webapps \根文件夾中, n不只是webapps .. so I pasted my ‘fun’ inside this ROOT folder…因此,我貼我的'玩笑'內的這根文件夾…
k but still gettin a blank page k ,但仍得不到一個空白頁
January 25th, 2005 at 7:58 pm 2005年1月25日在下午7點58分
oh..哦.. and one more thing… my root already seems to have a WEB-INF with a lib n web.xml within it…和一更多的事…我的根似乎已經有一個網站-干擾素與庫n web.xml內…
this doesn affect anything rite ?這並不影響什麼禮儀?
January 25th, 2005 at 11:30 pm 2005年1月25日在下午11時30分
HTTP Status 500 - HTTP狀態500 -
——————————————————————————– ---------------------------
type Exception report類型例外報告
message訊息
description The server encountered an internal error () that prevented it from fulfilling this request.說明服務器遇到內部錯誤( )表示,無法履行這項要求。
exception例外
javax.servlet.ServletException: Servlet.init() for servlet php threw exception javax.servlet.servletexception : servlet.init ( )為Servlet的PHP的投擲例外
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.valves.errorreportvalve.invoke ( errorreportvalve.java : 105 )
[snipped] [ snipped ] [絲帶]
root cause的根源
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path java.lang.unsatisfiedlinkerror :沒有php5servlet在java.library.path
java.lang.ClassLoader.loadLibrary(Unknown Source) java.lang.classloader.loadlibrary (來源不明)
[snipped] [ snipped ] [絲帶]
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.4 logs.注意充分堆棧跟踪的根本原因,可在Apache Tomcat/5.5.4阿帕奇tomcat/5.5.4日誌。
——————————————————————————– ---------------------------
Apache Tomcat/5.5.4 Apache Tomcat/5.5.4阿帕奇tomcat/5.5.4
January 25th, 2005 at 11:31 pm 2005年1月25日在下午11時31分
hmmm “webapps” seems to be the root now… haha hmmm “ webapps ”似乎是根源,現在… haha
and the ‘php5srvlt.jar’ is inside the tomcat - ‘C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\run\WEB-INF\lib’ folder..和' php5srvlt.jar '是內雄貓-'為C : \程序文件\ A pache軟件基金會\的T omcat5 .5\ w ebapps\運行\網站-干擾素\庫'文件夾. .
but still gettin the same error as Brain….但仍得不到相同的錯誤,作為腦… … 。 as stated in the above previous post..正如在上述先前的文章..
January 26th, 2005 at 12:49 am 2005年1月26日在上午12時49分
Nikhli, Nikhli , nikhli ,
Please read the tomcat documentation.請閱讀雄貓文件。
To create a web app you can either use ROOT (not advisable) or create a directory with any name and create certain directories like WEB-INF under it.要創建一個Web應用程序您可以使用根(不宜)或創建一個目錄以任何名義和創造一定的目錄一樣,網絡的INF下。 Also create a web.xml under WEB-INF.還創建一個web.xml下的Web -干擾素。
January 26th, 2005 at 4:57 am 2005年1月26日在上午04時57分
Hi angsuman,喜由Angsuman ,
yup, did that, but still the error燁,這樣做,但仍有錯誤
January 26th, 2005 at 2:30 pm 2005年1月26日下午2時30分
hi Nikhil, all –喜nikhil ,所有-
I have the answer to your problem, which I was encountering also.我有回答你的問題,我遇到了也。 Just got this working after about an hour of banging on it.剛剛得到這個工作後,約一個小時的對撞。
The problem is that the reflect.properties and servlet.properties files that we are modifying inside the jar actually point to the DLL file….so the line MUST read問題是,該reflect.properties和servlet.properties文件,我們正在修改內的罐子,其實點到DLL文件… … 。因此,線必須閱讀
library=php5servlet圖書館= php5servlet
Because the instructions above are unclear, we were all confused about the difference between the names php5srvlt and php5servlet.因為上述指示不清楚,我們都感到困惑之間的差額姓名php5srvlt和php5servlet 。
In reality, the name of the jar file (phpsrvlt.jar) is irrelevant, since Tomcat will automatically load ANY jar file in the apps WEB-INF/lib directory.在現實中,名稱jar文件( phpsrvlt.jar )無關,因為雄貓會自動加載任何JAR文件,在應用服務web-inf/lib目錄。
Through some magic that I don’t understand, the library=php5servlet line tells the classes in the Jar file to call out to the native environment and load the native DLL of the same name (which is why it must be on the PATH)通過一些魔術,我不明白,圖書館= php5servlet線告訴班在JAR文件要求,以本土環境和負載本土的DLL的名稱相同的(這就是為什麼它必須對路徑)
Hope this helps - post your response.希望這會有所幫助-發布您的回應。
tx德克薩斯州
Jason賈森
January 27th, 2005 at 7:04 pm 2005年1月27日在下午7點04分
Thanks Jason for the tip.感謝傑森為小費。 I didn’t realize that people were making the incorrect assumption between the dll file name and the jar file name.我並沒有認識到人,使不正確假設之間的DLL文件的名稱和jar文件的名稱。 I have updated the document to clarify this.我有更新的文件,以澄清這一點。
> Through some magic that I don’t understand, the library=php5servlet line tells the classes in the Jar file to call out to the native environment and load the native DLL of the same name (which is why it must be on the PATH) >通過一些魔術,我不明白,圖書館= php5servlet線告訴班在JAR文件要求,以本土環境和負載本土的DLL的名稱相同的(這就是為什麼它必須對路徑)
No magic here.沒有魔術在這裡。 Just a simple loadLibrary call to load the native dll.只是一個簡單的loadlibrary呼籲負荷本土的DLL 。 JNI is used here for communicating with the php processor. jni用在這裡溝通與php處理器。
January 28th, 2005 at 6:24 am 2005年1月28日在上午06時24分
I am getting this error repeatedly no matter what I do to resolve it..:(我收到這個錯誤一再不管我解決這個問題.. : (
description The server encountered an internal error () that prevented it from fulfilling this request.說明服務器遇到內部錯誤( )表示,無法履行這項要求。
exception例外
javax.servlet.ServletException: Servlet.init() for servlet php threw exception javax.servlet.servletexception : servlet.init ( )為Servlet的PHP的投擲例外
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.valves.errorreportvalve.invoke ( errorreportvalve.java : 105 )
[snipped] [ snipped ] [絲帶]
root cause的根源
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path java.lang.unsatisfiedlinkerror :沒有php5servlet在java.library.path
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517) java.lang.classloader.loadlibrary ( classloader.java : 1517 )
[snipped] [ snipped ] [絲帶]
If I reload the page, it would be如果我重新載入網頁,便
description The server encountered an internal error () that prevented it from fulfilling this request.說明服務器遇到內部錯誤( )表示,無法履行這項要求。
exception例外
javax.servlet.ServletException: Servlet execution threw an exception javax.servlet.servletexception : Servlet的執行投擲一個例外
root cause的根源
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
net.php.servlet.send(Native Method) net.php.servlet.send ( native方法)
net.php.servlet.service(servlet.java:190) net.php.servlet.service ( servlet.java : 190 )
net.php.servlet.service(servlet.java:214) net.php.servlet.service ( servlet.java : 214 )
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) javax.servlet.http.httpservlet.service ( httpservlet.java : 802 )
I have gone through all the suggestions above and I still could not find where the problem is..can any one help me?我已經通過所有上述建議,我仍然無法找到問題所在..可以是任何一個我有什麼幫助?
Thanks,謝謝,
Mallika瑪麗卡
January 28th, 2005 at 9:40 am 2005年1月28日在上午09時40分
Hi,嗨,
getting PHP to work in Tomcat is exactly what I need. PHP上工作,在Tomcat ,這正是我需要。 So the above instructions are awsome.所以,上述指示是awsome 。 But has anybody actually got it to run yet?但事實上,任何人得到它運行了沒?
And do you know if the same instructions should work on other platforms such as Unix or Mac OS X. Or if not do you know how to get it to work on other platforms?和你知不知道如果同樣的工作指示,應在其他平台上,如UNIX或Mac OS X上,或如果沒有你知不知道如何獲取它的工作在其他平台上?
Thanks,謝謝,
Meike致謝Meikemeike
January 28th, 2005 at 2:33 pm 2005年1月28日在下午2時33分
Meiki, I received email from a number of people who were successful in running it. meiki ,我收到的電子郵件從一個有多少人誰是成功的在運行它。 See the comments above also.看到上述評論也。
Mallika,瑪麗卡,
> java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path > java.lang.unsatisfiedlinkerror :沒有php5servlet在java.library.path
Ensure that the name of the dll file is the same name that you specified in both the properties file in the jar which you have modified.確保DLL的名稱的文件是相同的名稱,您所指定的在這兩個屬性文件中的罐子,你修改。 Please check the instructions again which I have updated to clarify the above issue.請檢查的指示,再次我更新,以澄清上述問題。 Also see the comments by Jason above.也看到的評論由Jason以上。
Hope that helps…希望幫助…
February 1st, 2005 at 2:59 am 2005年2月1日在上午02時59分
I got it, finally.我得到它,最後。 I was doing mistake in recreating jar file after the changes were made to the .properties files.我是這樣做的錯誤,休閒,娛樂為jar文件後,更改了。屬性文件。 Thanks anyways, Angsuman.感謝anyways的, Angsumanangsuman 。 Your article is indeed very helpful.您的文章實在是非常有幫助。
- Mallika -瑪麗卡
February 5th, 2005 at 9:36 am 2005年2月5日在上午09時36分
So I managed to get PHP running on Tomcat 5.5, but im not getting a querky error.因此,我設法讓PHP上運行的Tomcat 5.5 ,但即時通訊得不到querky錯誤。 After banging on my webserver for only a minute or two, tomcat seems to be crashing and the webpage will display the following error:後撞我的網頁伺服器,只有一兩分鐘,雄貓似乎被撞毀,並在網頁上會顯示以下錯誤:
Proxy Error Proxy錯誤
The proxy server received an invalid response from an upstream server.代理服務器收到無效的響應從上游服務器。
The proxy server could not handle the request GET /index.php.代理服務器不能處理的請求,得到/的index.php 。
Reason: Error reading from remote server原因是:讀取時發生錯誤,從遠程服務器
Has anyone else encountered this error and does anyone have any ideas on how to troubleshoot it?有其他人所遇到的這個錯誤和有沒有人有任何意見,如何解決呢? I’ve checked the Tomcat 5.5 logs and they appear to be ok.我已經檢查的Tomcat 5.5日誌和他們似乎是確定。 After getting this error I have to restart Tomcat to bring it back up again.後收到這個錯誤,我要重新啟動的Tomcat ,使其回到了一次。 Any help would me most appreciated.任何幫助,將我最讚賞的。 Thanks!謝謝!
February 5th, 2005 at 10:30 pm 2005年2月5日下午10時30分
This error happens when a proxy server is accessed like a normal web server.這個錯誤發生時,代理服務器的訪問一樣,一個正常的Web伺服器。 This has nothing to do with php installation AFAIK.這是PHP沒有安裝afaik 。
Are you accessing the actual tomcat page os are you accessing a proxy server URL instead?你進入實際的Tomcat網頁操作系統,你訪問的代理服務器的網址,而是? Check your port.檢查您的港口。 Tomcat by default runs on 8080.雄貓默認情況下運行於8080 。 Do you have a proxy server running on your machine?你是否有代理服務器上運行您的機器?
February 6th, 2005 at 3:49 am 2005年2月6日在上午03時49分
There is no proxy proxy running, and the webserver is running on 8080.有沒有代理代理運行,並且網絡服務器上運行的8080 。 the weird thing is that i can view my webpage going back and forth from different pages, and it works fine.怪異的是,我可以查看我的網頁去回,並提出了從不同的頁面,和它的優良工程。 Then for some reason, i click on a link which i already verified, and it gives me the error message i previously posted.然後出於某種原因,我點擊一個鏈接,我已驗證,它讓我有錯誤訊息我先前張貼。 I’ve done this over and over again, and it seems random where the errors are occuring.我已經這樣做了以上和一次又一次的,似乎隨機的地方錯誤的發生。 Sometimes it on one link, other times it’s on others.有時就一個環節,其他時候的對等。 I tried this using the jsp pages included in the installation and was unable to reproduce the error, thus why i’m concluding that it must be a problem with the PHP installation.我嘗試使用這個JSP頁面包括在安裝和無法重現錯誤,因此,為什麼我得出結論認為,它必須是一個問題, PHP安裝。 Has anyone else tried doing this installation on Tomcat 5.5.4 using JDK 5.0???有其他人試圖這樣做的安裝的Tomcat 5.5.4使用JDK 5.0 ? ? ?
February 6th, 2005 at 6:13 am 2005年2月6日在上午06時13分
So I’ve investigated more and discovered that the proxy error is from my parent server but only because my server is being crashed.因此,我已經調查更發現,代理錯誤,是從我的父母服務器,但只是因為我的服務器是被墜毀。 I’ve run the same test on my local machine and recieved the following error:我已經運行同樣的測試對我的本地機器上,並收到以下錯誤:
The connection was refused when attempting to contact localhost:8080連接被拒絕時,試圖聯繫本地: 8080
This appears to be only because the server is down, and doesn’t seem to help much with troubleshooting.這似乎是不僅是因為服務器已關閉,似乎沒有多大幫助與故障排除。 But for some reason, on random requests, like i stated in my previous post, the server is being crashed.但出於某種原因,就隨機的要求,像我在我先前的文章,該服務器目前正在墜毀。 Any ideas?任何想法?
Thanks again!再次感謝!
February 6th, 2005 at 6:20 am 2005年2月6日在上午06時20分
Also, I’ve noticed that php only works when i put the php5srvlt.jar in the common/lib directory and it will not work in the webapps/www/lib directory.此外,我發現PHP的工程,只有當我把php5srvlt.jar在共同/ lib目錄中的目錄和它將無法工作,在webapps /萬維網/ lib目錄中的目錄。
webapps/www is where my website is located webapps / www是哪裡我的網站是位於
February 6th, 2005 at 3:22 pm 2005年2月6日在下午3時22分
Brian,布賴恩,
I haven’t faced any server crashing issue.我有沒有面對任何服務器崩潰的問題。 The php5srvlt.jar can be in common.lib.該php5srvlt.jar可以在common.lib 。 It can also be in www/WEb-INF/lib directory where www is your webapps directory.它也可以在WWW /網絡-干擾素/ lib目錄所在的目錄www是您的webapps目錄。 The second way (as mentioned in the post above) is useful for people who use a shared tomcat instance as provided by their hosting provider.第二種方式(如提到,在後段)是有益的人,誰使用共享的Tomcat ,例如提供其託管服務提供商。 Also it allows you to limit the capability to one web application only.此外,它允許你限制的能力之一, Web應用程序只。
February 8th, 2005 at 10:00 pm 2005年2月8日在下午10點
Hallo,嘿,
what is meant with Point 15 (add c:php …).是什麼意思,與15點(添加c : PHP的… … ) 。 I opend SystemEnvironment and added a new systemVariable: name=php and value= c:\php. i opend systemenvironment ,並增添了一個新的systemvariable :姓名= PHP和值=將C : \ php 。 Is this correct?這是正確的呢? I ask because I get an error message wehn trying to load the test.php and maybe this is the reason.我想請問,因為我得到一個錯誤信息,當試圖加載test.php和也許這就是原因。
Greets電賀
Error Message:錯誤訊息:
…
root cause的根源
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
at net.php.servlet.send(Native Method)在net.php.servlet.send ( native方法)
at net.php.servlet.service(servlet.java:190在net.php.servlet.service ( servlet.java : 190
…
kai啟
February 8th, 2005 at 10:09 pm 2005年2月8日在下午10時09分
Kai,啟,
Thanks for pointing out the error of missing backward-slash, It happened when I recently edited the post to add some clarifications.感謝指出錯誤失踪落後-斜線,它發生時,我最近編輯後添加一些澄清。 In the process I forgot that the post contains some backword-slashes.在這個過程中我忘了該職位包含一些backword -斜線。 Now my blog software unfortunately eats away one backward-slash everytime I edit a post.現在我的博客軟件,可惜吃遠離一落後-斜線每次編輯後。 So I have to manually replace each single backward-slash with double.所以,我必須以手動方式取代落後的每個單-雙斜線。 Unfortunately I forgot to do that in this instance.不幸的是,我忘記了這樣做,在這方面,例如。 Thanks again for pointing it out.再次感謝將它指向。
Let us know how it goes.讓我們知道如何為這是不言而喻的。
February 8th, 2005 at 10:48 pm 2005年2月8日在下午10時48分
So, if this is not the error, I don’t know what’s wrong.因此,如果這不是錯誤,我不知道有什麼不對。 I copied php5servlet.dll into c:/php. i複製php5servlet.dll到C : / PHP中。 Than I created the directories and modified the two files.比我創造了目錄和修改的兩個文件。 My directory Structure is:我的目錄結構是:
webapps/fun –> test.php, WEB-INF webapps /樂趣-> “ t est.php,網站-干擾素
WEB-INF –> lib, web.xml網絡-干擾素-> “庫, w eb.xml
lib –> php5srvlt.jar庫-> “ p hp5srvlt.jar
But after restarting Tomcat I get the the following error message.但在重新啟動後的Tomcat我得到以下錯誤消息。 And when I reload the website I get the same message with a different root cause.當我重新載入網頁我得到相同的訊息與不同的根源。
I read the posts about this problem, but none of the solutions woked for me.我看過的職位對這個問題,但沒有解決woked我。
1. 1 。 Exception例外
description The server encountered an internal error () that prevented it from fulfilling this request.說明服務器遇到內部錯誤( )表示,無法履行這項要求。
exception例外
javax.servlet.ServletException: Servlet execution threw an exception javax.servlet.servletexception : Servlet的執行投擲一個例外
…
[snipped] [ snipped ] [絲帶]
2. 2 。 Exception例外
…
root cause的根源
java.lang.UnsatisfiedLinkError: send java.lang.UnsatisfiedLinkError : sendjava.lang.unsatisfiedlinkerror :發送
at net.php.servlet.send(Native Method)在net.php.servlet.send ( native方法)
at net.php.servlet.service(servlet.java:190)在net.php.servlet.service ( servlet.java : 190 )
[snipped] [ snipped ] [絲帶]
February 9th, 2005 at 2:07 am 2005年2月9日在上午02時07分
Kai,啟,
Read the comment by Jason above.讀評論由Jason以上。 This problem happens due to improper specification of the location of php5servlet.dll in the properties file.這個問題的發生是由於不當的具體位置php5servlet.dll在屬性文件。
Please check the comments above as others have also faced and solved the same issue.請檢查上述評論正如其他人也面臨和解決的相同問題。
February 9th, 2005 at 7:15 pm 2005年2月9日晚上7時15分
IMPORTANT: Everybody with an unsatisfied link error double check that you do not have an extra whitespace in the properties files that you change.重要說明:每個人都與一不滿鏈接錯誤,仔細檢查你沒有一個額外的空白,在性能檔案,你的變化。 Servlet.properties and Reflect.properties both have extraneous whitespaces after the names of the dlls. servlet.properties和reflect.properties都有外在whitespaces後的名稱的DLL 。
Thanks for the great HOW-TO!感謝偉大的如何!
February 9th, 2005 at 9:22 pm 2005年2月9日在下午9點22分
Hi,嗨,
I read the comments.我讀的評論。 Also the one of Jason.也之一傑森。 But still the same error message.但相同的錯誤訊息。 Maybe I do something wrong when extracting the phpsrvlt.jar.也許我做一些錯誤時,提取phpsrvlt.jar 。 I’ve opened the file with winrar, made the changes and saved the file without extracting it.我已經開啟檔案與WinRAR的,取得的變化和保存文件沒有提取。
February 10th, 2005 at 2:14 am 2005年2月10日在上午02時14分
HI,嗨,
ich have the same problem like Sachin , how can i solve it?腦出血有同樣的問題一樣,分析師,我如何才能解決呢?
2005-02-10 14:51:16,622 [http-8080-Processor25] WARN StandardWrapper[/ikarus_prototype:php] - Servlet.service() for servlet php threw exception
java.io.IOException: ? l ? ll ? l
at net.php.servlet.send(Native Method)
[snipped]
10.02.2005 15:00:54 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
10.02.2005 15:00:55 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0×0c08f185, pid=1640, tid=1912
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode)
# Problematic frame:
# C [php5ts.dll+0x3f185]
#
# An error report file with more information is saved as hs_err_pid1640.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
February 10th, 2005 at 2:45 am
Kai,
Check the jar file again to see if the changes are properly saved. Check the pointer by ez.
EZ,
Thanks for the pointer.
Dennis,
One simple thought. Please restart the server and see if the error persists. Have you checked the suggestions and hints in the comments section by numerous readers?
February 10th, 2005 at 7:32 pm
Thanks Angsuman, it’s works.
Don’t know why
Yesterday i’ve restarted Tomc@ and Windows several times but without an effect. (got an unexpected error caused by php5servlet.dll)
But today… hmmmm it’s works! : \
Are you running your Tomc@ as a service?
What about JavaVM 1.5 or 1.4?
February 14th, 2005 at 4:11 pm
I’m also still getting the UnsatisfiedError after checking the *.properties files several times in notepad. also $PATH includes as I can run the command “php” from anywhere. But when trying that I encountered the following error:
PHP Startup: Unable to load dynamic library ‘./php_java.dll’ - The specified module could not be found.
which is true as far as i know as there is no such file in c:\php, but when browsing through the files a found a php_java.jar in c:\php\ext. does anyone know what is wrong in my configuration?
Thank you for this tutorial, i appreciate it
felix
February 14th, 2005 at 4:33 pm
Felix,
Check the PECL modules (instruction 2) you have downloaded.
Thanks for the compliment.
Angsuman
February 14th, 2005 at 4:52 pm
Works beautifully
Thank you again!
felix
February 16th, 2005 at 7:05 pm
To start off, i have read through each and every post on this thread… Still getting the following error when attempting to load my test.php page.
Feb 16, 2005 11:31:45 PM org.apache.catalina.core.StandardWrapperValve invoke
WARNING: Servlet.service() for servlet php threw exception
java.io.IOException: `R, `R, hR, TV, ?
at net.php.servlet.send(Native Method)
[snipped]
I noticed Sachin had this problem, and resolved it somehow …? Any help would be most appreciated.
February 16th, 2005 at 10:15 pm
One simple thought. Please restart the server and see if the error persists.
February 17th, 2005 at 1:16 am
I followed the steps but…
javax.servlet.ServletException: Wrapper cannot find servlet class net.php.servlet or a class it depends on
[snipped]
root cause
java.lang.ClassNotFoundException: net.php.servlet
[snipped]
what should i do????
February 17th, 2005 at 2:06 am
Hi Angsuman,
Your tutorial has been a great help.
but i still have the
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
error.
i have read all the comments above and done the necessary changes.
when i recreate the jar (jar cvf php5srvlt.jar net/php/*.* ) the class files are not getting created (servlet.class, reflect.class) which were there before. what should i do?
any help would be really appreciated.
thanks a lot
Meera.
February 17th, 2005 at 2:11 am
Hi,
i want to use the SAPI module in php to make a servlet running in tomcat handle a php request.
any pointers about how to go about this would be really helpful.
thanks a lot.
Meera.
February 17th, 2005 at 3:50 am
Guto,
Check to see the jar file is under the WEB-INF\lib directory as required.
Meera,
Looks like you are not creating the jar file properly with changes. Please follow the steps exactly. Also please check my comment on 1/2/2005 on the same topic.
February 17th, 2005 at 4:50 pm
First of all, thanks Angsuman for the tutorial and also the people that have replied with tips. ^_^
I had that “java.lang.UnsatisfiedLinkError: send” error for a while and the solution was simply to completely restart the tomcat server.
Now it works fine but every time I go to localhost:8080/fun I can see the index.php as if it didn’t auto-recognize the file! Anyone has any idea how to fix this?
Note: I know to fix this on an Apache server you would do something like “DirectoryIndex index.html index.html.var index.php ” but for Tomcat I have no clue.
thanks.
Dlfiles
February 17th, 2005 at 8:42 pm
hi,
Thanks for tip. I no longer have the UnsatisfiedLinkError.
But this is the error i get when i try to run any php program inside the fun directory. If i place a php file in the root directory, it is not getting parsed. ( the dialog box offering to save or open the file appears)
java.io.IOException: ¸2Bm
at net.php.servlet.send(Native Method)
[snipped]
thanks,
Meera.
February 18th, 2005 at 4:49 am
Meera,
As DlFiles mentioned before you:
February 18th, 2005 at 5:13 am
Dlfiles,
Add the following at the end of the web.xml of your web application, before the </web-app> tag.
<welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>You can similarly use other extensions too. The default extensions are jsp, htm and html, defined in conf/web.xml.
February 18th, 2005 at 10:32 am
Angsuman,
Everything is working fine now! thanks again!
March 6th, 2005 at 2:04 am
FYI, I just tried using the web.xml you have listed above and the servlet did load. I removed the DOCTYPE line and it worked. I think you may have something wrong with your slashes possibly. However, the doctype isn’t required.
PS thanks for all the help, your tutorial is excellent!
March 6th, 2005 at 2:41 am
So i’ve reinstalled everything and I’m getting random errors killing the Tomcat server still. in my system32 folder there is a log which is printing out the following… any ideas??? it looks like there is an error in php5ts.dll.
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0×0583eced, pid=832, tid=3472
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode, sharing)
# Problematic frame:
# C [php5ts.dll+0x3eced]
#
————— THREAD —————
Current thread (0×032b1438): JavaThread “http-8080-Processor25″ daemon [_thread_in_native, id=3472]
siginfo: ExceptionCode=0xc0000005, reading address 0×00000016
Registers:
EAX=0×035c5668, EBX=0×00000002, ECX=0×00000002, EDX=0×00000007
ESP=0×051fef64, EBP=0×77c2c21b, ESI=0×05c1c6c8, EDI=0×035c5668
EIP=0×0583eced, EFLAGS=0×00010297
Top of Stack: (sp=0×051fef64)
0×051fef64: 05c1c6c8 051ff120 032b3998 0585fe90
0×051fef74: 00000002 05c1c6fc 0583b7dd 05c1c6c8
0×051fef84: 05c1c6f0 0583ee74 05c1c6fc 051ff118
0×051fef94: 035c5668 051ff120 032b3998 0583ef43
0×051fefa4: 035c5668 05c1c6f0 035c56f8 0583b039
0×051fefb4: 035c5668 035c57f4 032b3998 05b48660
0×051fefc4: 0583b5f0 032b3998 035c56f8 051ff1f8
0×051fefd4: 032b3998 032b1438 032b1438 00000006
Instructions: (pc=0×0583eced)
0×0583ecdd: 90 90 90 53 8b 5c 24 08 55 8b 2d 18 a2 9f 05 56
0×0583eced: 8b 73 14 85 f6 74 51 57 8b 43 20 8b fe 8b 76 10
Stack: [0x05100000,0x05200000), sp=0x051fef64, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [php5ts.dll+0x3eced]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j [Truncated]
March 6th, 2005 at 2:44 am
So I’ve reinstalled everything and I’m still getting the same problems where after clicking a bunch of links on my page, my Tomcat server crashes. there is an error log in my system32 folder that is printing out the following. it looks like there is an error in php5ts.dll… and ideas???
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0×0583eced, pid=832, tid=3472
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode, sharing)
# Problematic frame:
# C [php5ts.dll+0x3eced]
#
————— THREAD —————
Current thread (0×032b1438): JavaThread “http-8080-Processor25″ daemon [_thread_in_native, id=3472]
siginfo: ExceptionCode=0xc0000005, reading address 0×00000016
Registers:
EAX=0×035c5668, EBX=0×00000002, ECX=0×00000002, EDX=0×00000007
ESP=0×051fef64, EBP=0×77c2c21b, ESI=0×05c1c6c8, EDI=0×035c5668
EIP=0×0583eced, EFLAGS=0×00010297
[snipped]
March 6th, 2005 at 2:45 am
im having trouble posting to your site maybe my post is too long… im trying to include an error log message
March 17th, 2005 at 8:44 pm
Brian,
Sorry for the delay in responding. The comments were getting gobbled up by a defective filter in WordPress 1.5 ( more on it soon ). I am looking at your problem now.
March 17th, 2005 at 8:53 pm
Brian> I think you may have something wrong with your slashes possibly. However, the doctype isn’t required.
You are correct. WordPress 1.5 messed up the double-quotes. I have removed them now. Thanks for the information.
March 17th, 2005 at 8:55 pm
@Brian Why is php5ts.dll in your path? I don’t remember seeing that.
March 18th, 2005 at 8:25 am
Your tutorial was of great help in getting php connected, but only seems to work for the first php applicaiton that I hit on my web server.
For instance if I copy webapps\fun to webapps\fun2 and restart Tomcat (4.0.6) and then access either of them, it works. But when I access the other one I get an error message:
java.lang.UnsatisfiedLinkError: Native Library C:\php\php5servlet.dll already loaded in another classloader
I tried moving the jar file into the common\lib and modifying the web.xml in the conf directory to include the servlet ans servlet-mapping directives, but can’t seem to find the right twist for it.
Starting service Tomcat-Standalone
Apache Tomcat/4.0.6
ERROR reading java.io.ByteArrayInputStream@161dfb5
At Line 11 /web-app/servlet/
Starting service Tomcat-Apache
Apache Tomcat/4.0.6
March 18th, 2005 at 8:56 am
Ah, “already loaded in another classloader” problem solved.
Move the php5srvlt.jar file out of the tomcat directory and put it in the Java jre/lib/ext directory
(C:\Java\j2sdk1.4.2_07\jre\lib\ext on my PC)
March 18th, 2005 at 1:59 pm
Are there anyone who commented on this post who couldn’t get it to running yet?
March 20th, 2005 at 11:10 pm
java.lang.UnsatisfiedLinkError: send
March 21st, 2005 at 4:31 am
@Manisha Please repeat step 6 & 11-15. I short you probably do not have the dll file extracted in proper place. But first restart the server and test again. Restart by itself may solve the problem as has happened for many.
April 7th, 2005 at 8:07 pm
Tanks for your step by step tutorial. I had it working, with Tomcat 5.0.19 and php 5.0.4. I spend a lot of time due to an error defining the PATH environment variable to add the php path, and even after the correction it was using the old setting. A boot fixed it. The only problem left is that running the test.php with the phpinfo() it does not disply the tho icons PHP Logo and Zend logo. Any idea?
April 9th, 2005 at 3:04 am
@Vincenzo
Where are the image url’s pointing to?
April 11th, 2005 at 1:52 am
I think they are embedded into php5ts.dll that is in the main dir of php (d:\PHP5). Viewing the source the relative tag is the following:
April 11th, 2005 at 8:41 pm
The html code has been removed from the previous message. Substitute the square brackets with the angle brackets in the following line:
[a href="http://www.php.net/" ][ img border="0" src="/fun/test.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" alt="PHP Logo" /][/a]
April 11th, 2005 at 11:27 pm
@Vincenzo
It shouldn’t affect your applications in any way which is good. However if you still want to fix it read on.
I did several installations, never faced it. So I was wondering if you could please re-check the steps to see if you are missing any small details. Looks like the problem may be with your PHP configuration.
April 20th, 2005 at 1:10 am
Hi, all
I’ve tried everything which is possible but still couldn’t get the php configured for the tomcat.
I’ve tried all the options, changing the servlet,reflect.properties but getting the specific error as:
“Exception is — > javax.servlet.ServletException: Servlet.init() for servlet php threw exception”
Infact I’ve restarted the tomcat server,but still not getting.
Plz help.
Regards
Vijay
April 21st, 2005 at 3:01 pm
What is the exception?
May 2nd, 2005 at 10:09 pm
Hi,
Thansk angsuman for this article but i couldnt make it work! I’ve done everything you wrote, but everytime i come up with the common error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.UnsatisfiedLinkError: send
net.php.servlet.send(Native Method)
net.php.servlet.service(servlet.java:190)
net.php.servlet.service(servlet.java:214)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
[snipped]
What should i do? Can you help? Thanks
May 2nd, 2005 at 10:27 pm
Please see the comments and responses above.
To quote from my comment:
May 3rd, 2005 at 10:01 pm
I’ve moved the jar file into the common/lib directory but the same error appeared again.
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.UnsatisfiedLinkError: send
net.php.servlet.send(Native Method)
net.php.servlet.service(servlet.java:190)
net.php.servlet.service(servlet.java:214)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
[snipped]
I’ll try to make a fresh start…
May 4th, 2005 at 12:58 am
@Orcun
Re-check steps 6 & 11-14.
> Extract php5servlet.dll from pecl zip file to c:\php (Uncheck “Use Folder Names” in WinZip).
Ensure that the file is actually present in c:\php
Also ensure php_java.dll is under c:\php
The problem is happening because it cannot find the dll file under php directory.
May 5th, 2005 at 9:15 pm
first of all, sorry about my poor english, i’m spanish :), and thx for the article
angsuman, copy the file php_java.dll in “extensions” and problem is solved (hope it helps. I think this is the problem
i have a problem with the process, when i try to load the index.php (the page with php_info()) i have and exception.
The exception is:
06-may-2005 11:37:14 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Excepción de reserva de espacio para servlet php
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
help please… thx in advance
May 6th, 2005 at 1:22 am
BTW: I am Bengali
I think your Tomcat hasn’t been installed properly in the first place. Can you run the example servlets & jsp?
> java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
This is actually a core jar file which is part of the installation.
May 23rd, 2005 at 1:18 am
heloo there Angsuman Chakraborty!!!
Nice guide!But a litle prob here, as the same with others, the error:
javax.servlet.ServletException: Servlet.init() for servlet php threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
[snipped]
root cause
java.lang.UnsatisfiedLinkError: no php5srvlt in java.library.path
[snipped]
always appearing, i dont know now what to do, im stuck, i did followed your guide neatly but dont have any clue!!!Please help, i actually need to run some php in jakarta!!!Thanks…
PS what j2sdk version, and tomcat version will work the best in this guide??Because someone here in our work required me to use j2sdk-1.4 and not the latest one (1.5).. And we are using tomcat 4.1.31 / 5.0.28.. Please help me…
May 23rd, 2005 at 2:41 am
@orbknives Please check mine (comment No 87 and before) and others comments above which explains the solution clearly. AFAIK it solved it for all.
In short check item no 5, 6 & 11-14.
The php jar file is trying to load the dll (whose name you specified in 11-14) and failing.
After verification of the above, just add c:\php to your system path (just to be safe).
Restart Tomcat and try again.
Let me know how it goes.
May 23rd, 2005 at 3:35 am
Ok thank you for the quick reply!!Actually i already read the whole thread, i seen same problem and i also followed those instructions but how come it didn’t work for me.. Do i need to used a specific version of JAVA of Tomcat?? Im using j2sdk1.4.2_07 and tomcat 5.0.28..In the no. 5 & 6, yes i created a copy of php.ini-dist and renamed it as php.ini (Uncomment the line ;extension=php_java.dll ) and paste back it at c:\php. I also check that the php5servlet.dll (from pecl.zip) is in th c:\php..
On the 11 - 14, yes i extracted and created again the php5srvlt.jar using
to unjar -> “jar xfv phpsrvlt.jar”
to Recreate -> “jar cvf php5srvlt.jar net/php/*.*
(are these are correct??)
Ofcourse before i recreated the jar i edited the reflect.properties and servlet.properties to change the line library=phpsrvlt to library=php5servlet (question: do i need to include the ‘.dll’ or just the php5servlet?) and i also checked that theres no left white spaces/lines. After the jar was created i paste it in WEB-INF\lib.. i even tried pasting it at tomcat\common\lib but same result…Bout the System variable, the NAME i inputed is PHP (uppercase) and C:\php for the value, is this correct??Thats all i did.. What could be the problem??What should i do next?i hope you will still help me till we fix this… Thanks…
May 23rd, 2005 at 10:03 am
Verify that the configuration files are being jar’ed to the same directory structure.
How?
Rename the original jar file as .zip and open it in Winzip etc. Note the directory structure aka path of the configuration files. Ensure that it is the same after you have re-jar’ed the file
Versions of Tomcat and JDK are fine.
Try adding c:\php to the beginning of the PATH variable in System Properties.
May 23rd, 2005 at 10:10 am
Are there anyone else who still have problems setting this up?
May 24th, 2005 at 3:01 am
Angsuman thanks a lot!!Its working now!!!i owe you one!!!By the way is it possible to do this in linux??Ever planned to create a guide for linux too??
Also, can i ask something bout php?and jnlp files, can i include a php script inside a jnlp file?Where my script is a sql query, when the condition is not met, the php script will block the execution of the jnlp..Any idea?Is this possible??????
May 24th, 2005 at 5:21 am
> By the way is it possible to do this in linux?
Sure. Why not? You just have to use shared objects (.so files) instead of dll’s. Normally though people, including myself, prefer running Apache server and configuring Tomcat to run with it and also php to run with it. It is much simpler that way.
You can refer to 5 Simple Steps to Integrate Tomcat 5.5 with Apache 2.0
> can i include a php script inside a jnlp file?Where my script is a sql query, when the condition is not met, the php script will block the execution of the jnlp..Any idea?Is this possible??????
Why not use a Filter to check the sql query before serving any jnlp file?
May 24th, 2005 at 7:51 am
So in linux, shared objects are the key, but will your guide be applicable if il try it on linux??Bout the tomcat-apache, is it stable and reliable??Also i dont want to hi-jack this thread but im hardly in need of help now. So use a Filter to check the sql query before serving any jnlp file, actually im a newbie in php, so any idea how can i block or prevent to execute jnlp files where in my main.php file has some hyperlinks directly to the jnlp (file.jnlp)..The only solution i see is include a php script in the jnlp, but i don’t know how to block the execution of that jnlp when it was click, something like this, (consider this as a jnlp)..
if (!$authentication)
exit(1);
some scipt here
So any idea?Or anything you think that can secure a jnlp file from executing if the condition was not met, ofcourse using php?? Again, Thanks!!!!!
May 24th, 2005 at 1:36 pm
I’m having trouble getting this to work. I’ve been at it for a couple of days, reading and re-reading all the posts. I’ve made it past the UnsatisfiedLinkError problem and am stuck on an java.io.IOException: ¸2Bm
at net.php.servlet.send(Native Method)
at net.php.servlet.service(servlet.java:190)
at net.php.servlet.service(servlet.java:214)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
…
May 24th, 2005 at 11:49 pm
@orbknives
On Linux:
Tomcat is very stable and production grade.
Tomcat-Apache combination is very stable and production grade.
You will have to make some common sense changes, but overall the same idea is applicable on Linux too.
I am assuming you will be serving JNLP file over a Tomcat server. Then you need to setup a Filter for .jnlp extension. In the filter code (java) you do whatever check is necessary. If the check succeeds then the user is able to download the jnlp file.
@Rick
First though. Restart Tomcat and check again. If that doesn’t fix it, let me know.
May 25th, 2005 at 7:37 am
Have restarted Tomcat (actually using JBoss with embedded Tomcat) several times to no avail.
May 25th, 2005 at 10:55 am
Is your exception identical to Meera’s IOException above?
Are you able to run normal JSP files from this web directory?
It is trying to load some filter which is not correct. It shouldn’t be loading any filter. Looks like a setup issue with Tomcat.
Can you find out the version of Tomcat you are running?
May 26th, 2005 at 1:07 pm
Hi, i’m getting the following famous error when running Tomcat 5.5.4 and PHP 5.0.4:
java.lang.UnsatisfiedLinkError: send
net.php.servlet.send(Native Method)
…
I swear I have followed all the steps: I changed the properties in phpsrvlt.jar to “php5servlet”, and placed that jar in common/lib. I also put php5servlet.dll in the php folder.
Do you think the problem may have to do with some CLASSPATH stuff? Thanks in advance.
May 26th, 2005 at 6:56 pm
Please check my comments 91 & 93. orbknives was recently having the same problem and it was solved.
Maybe orbknives can also provide you some pointers…
May 26th, 2005 at 10:36 pm
Hello Guys,
I was trying to install my php 5 under tomcat 5.
I read the complete converstation as I was also facing the same problem of servlet like..
root cause
java.lang.ClassNotFoundException: net.php.servlet
[snipped]
——————
Finally i got the solution..
It was suggested in the first message by Angsuman that after making the changes in the properties file, recreate the jar file using jar…
I did the same way but when i saw the size of the new jar file and compared with the size of old jar file, it was varying a lot.
So i opened my old-jar file in the winzip and opened the properties files and made the changes and then saved them on the hard-disk in c:\net\php\
Then in my winzip window i added those files by clicking the add button. Dont forget to check the check box which says “save full path info”. Doing this replaced my properties files in the jar files with the new files i saved on the hard disk.
I did the same way with both the files and got my same jar file modified with the required changes.
This time my jar file was approx of the same size.
Rest all i did same as suggested by Angsuman and it worked properly..
Thanks
Anuj
May 26th, 2005 at 11:42 pm
Thanks Anuj.
May 27th, 2005 at 5:28 am
Angsuman, I just got it working all toghether. The reason of the failure was that I had forgotten to place the php5servlet.dll in the windows/system folder. Thank you for your help and for using your time in helping other people
May 30th, 2005 at 2:04 pm
hey Angsuman, thanks for of this and to me this would be great if i could finally get it to work…
unfortunatly I can only get : java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
to me i did all your step but there are just a few things i want to make sure :
1 - in step 15 you say : Add c:\php to your System or User Path in Windows enironment (Hint: Right-click and select Properties from My Computer)
but what name should I give it? php?
2 - library=php5servlet… no lines or spaces after right?
3 - i moved the php5srvlt.jar from fun/WEB-INF/lib to commun/lib and then back again… no changes there
4 - phpsrvlt.jar is 16kb, but when I rejar it to php5srvlt.jar it goes down to 9kb…. i did what anuj says but it didnt change anything… my php5srvlt.jar is now 16kb thou…
hope there is something I missed here and can be fixed…
thanks for all your great work and the inout from everybody else… seems that i just cant see the light…
May 30th, 2005 at 8:57 pm
Please see all the comments and discussion above.
You missed step 15. You just need to add c:\php to existing PATH variable.
2. Yes
4. Open it and make sure the path of the config files are same as before.
June 6th, 2005 at 7:25 pm
I have been keeping getting the
“UnsatisfiedLinkError problem”.I almost gave up.
But, after reboot PC(Win2Kserver) , it works fine.
Maybe rebooting tomcat is not enough to
reset the PATH environment variables.
Angusman,Thank you for very usefull article!
June 8th, 2005 at 2:22 am
I have below problem (like Sachin, Dennis,..). I also restart server many times but the problem doesn’t go away.
When I stop/start tomcat service and refresh the page (http://localost:8080/fun/test.php), system shows the warning “Module Java already loaded” (a popup message).
Help me!
June 8th, 2005 at 2:24 am
I have below problem (like Sachin, Dennis,..). I also restart server many times but the problem doesn’t go away.
java.io.IOException: ‡j ‡j ‡j ‹j €
net.php.servlet.send(Native Method)
net.php.servlet.service(servlet.java:190)
net.php.servlet.service(servlet.java:214)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
When I stop/start tomcat service and refresh the page (http://localost:8080/fun/test.php), system shows the warning “Module Java already loaded” (a popup message).
Help me!
June 9th, 2005 at 12:03 am
@haudv
Please double-check the instructions.
Please refer to the comments above for additional information and clarifications.
Try restarting the machine.
June 13th, 2005 at 5:39 am
exception
javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
…
root cause
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
[snipped]
i’ve tried all the given solutions but none worked except this suggested by Mr. Bahrat Soni
“only system variable will work for php path setting , if u have created a user variable then it won’t work and will give such exception so add the path c:\php in ur system variables……”
June 16th, 2005 at 12:12 am
Hello All,
Whoever is getting this error “java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path”. Please check the two properties file, whether there are any blank spaces. I was stuck in this problem for 2 days. There should be only one line, and no blank spaces.
Check it now!!!. This is where the problem is lying.
June 17th, 2005 at 8:28 am
ARUNDHATI, thank you very much!!
The issue are the blank spaces!!!
I suggest Angsuman to update the instructions… And, of course, thank you a lot too, Angsuman
June 17th, 2005 at 9:22 am
The post has been updated with Arundhati’s comment. Thanks Arundhati.
June 27th, 2005 at 2:35 pm
Thanks for the instructions. I followed them and aftyer a few tries it works. Well, most of the time.
I have a problem that when I send a POST messages with somehow large pieces of text (22K of XML code to be precise) it crashes Tomcat (5.0.18). Basically it hangs and after a while it dies. I tested the same files in a Linux installation and it ran fine.
Has anybody found a similar problem? Is it a bug with php’s servlet implementation? Or do you think I have a problem with my installation?
I appreciate any help
Thank!
June 27th, 2005 at 6:55 pm
@lfr
It doesn’t look like an installation problem. try upgrading to Tomcat 5.5 and see if that helps.
That 22K is it for some php file or just to an ordinary servlet?
BTW: If you have any suggestions on improving the instructions let me know.
June 28th, 2005 at 6:39 pm
Awesome tutorial! Thank you very much. I would suggest that instead of adding C:\php to the path (as suggested in step 15) you may want to modify your Tomcat Properties (Start-Programs-Tomcat-Configure Tomcat), in Java tab add a line to Java Options: -Djava.library.path=C:\php or similar.
Also, I have the same problem as in posts 79-80: the pictures in phpinfo() are not coming through. I don’t know if anybody figured out what can be causing it.
June 28th, 2005 at 8:19 pm
@Felix
That is a good idea. Having it in path is actually useful for other scenarios also like when you want to test your php scripts on command line. The reason I included it in path is bacause it makes installation simpler.
July 6th, 2005 at 4:46 am
Great tute, thanks Angusman!!
OK..Well so that I wouldnt be *bitten* I read the tute maticulously..and even went through a hefty amount of questions.. though when I tried it all out.. I received the error “UnsatisfiedLinkError…”
The problem is that for some F&*&*& reason, the User Path or System Path is not correctly refreshed in my environment.. SOO when I rebooted the machine (win xp pro sp 2) it worked fine!
I JUST REALISED.. the shell (dos window) that I was running stop and start for the Tomcat Apache Service would have probably *NOT* been updated with the new Environment variables hence why I kept getting this error.. maybe if I had opened another dos window and re-issued the net stop/start tomcat5 command it would of worked.. anyways by rebooting it all worked fine which leads me to believe its just a PATH issue..
Thanks again
Sam
July 6th, 2005 at 6:26 am
Sorry.. just a quick one.. is it possible to use openLDAP with PHP and tomcat in windows ??
Thanks
Sam
July 10th, 2005 at 12:02 am
nice tutorial. Thanks,
It seems to be working mostly correct. the phpinfo() outputs almost everything to the webpage, but my last few _ENV variables show up in the command window where the tomcat server startup info is displayed. Trying to output anything else sends it directly to the command window and the webpage comes up blank. Any help on this would be greatly appreciated.
Thanks.
July 13th, 2005 at 2:53 am
Hi,
I thought I had successfully configured php for tomcat in windows as when I invoked:
It seemed to work fine..
HOWEVER.. when I tried to issue a echo “BLAH”; nothing happends.. I have tried this on my work and home computer and the same results.. I have a requirement to build a php application to talk to our LDAP server..
Soo in short php is not working as I thought it would work.. Even when I put some html code outside the php tags nothing is rendered, nothing in view-source..
Any ideas??
Thanks
Sam
July 13th, 2005 at 2:55 am
Sorry before when I said I invoked it ommitted the actual command which was
phpinfo();Thanks
Sam
July 13th, 2005 at 11:01 am
Wonderful. So you are done.
September 1st, 2005 at 3:15 pm
Thanks very much for this information. I now have a Lotus Domino server serving the public with tomcat\php running behind the scenes locally to generate jsp and php pages. Absolutely awesome!!!
September 3rd, 2005 at 7:56 pm
Just solved the link error problem, like Sam above, by rebooting (also XP Pro SP2). Might the problem be in running Tomcat as a service? Starting and stopping is not enough. Thanks for really good page and your patience with all of us
September 17th, 2005 at 8:26 am
Loaded PHP and tomcat and followed all the steps.
But Blank sceen is being displayed when I am running the test.php page.
October 1st, 2005 at 11:33 am
Hi everyone, i had this problem for the longest time:
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
I set the %PATH% to c:\php but it still would not find it.
If any of you are using Tomcat monitor, try adding c:\php to the working path in configurations. This solved the problem for me.
Restart and try it. Hope this helps.
Thanks for the tutorial
October 1st, 2005 at 8:55 pm
@Elmer
Good to know it worked for you.
I did mention that in comment 91 above.
@Prasad Please re-check the steps carefully. Also take some time to read the comments as there are valuable hints there. Let me know if the problem still persists.
October 2nd, 2005 at 12:54 pm
After long frustration I’ve almost gotten it to work. But I’m still getting: java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
I already removed the blank spaces so it’s not that. I also have C:\PHP\ in windows’s environment variables.
I also tried to add the native libraries with VM flag -Djava.library.path=C:\PHP\
But this results into:
java.lang.UnsatisfiedLinkError: C:\PHP\php5servlet.dll: Can’t find dependent libraries
Anyone?
October 2nd, 2005 at 2:25 pm
OK, it worked after rebooting computer. After that I was getting lots of weird errors like ClassLoader already in use etc. and they all vanished after switching from Mustang to Tiger.
Thanks for a nice article
October 2nd, 2005 at 4:18 pm
… actually I was wrong and I guess lucky or something as it now still crashes when reloading pages (but with JDK 6.0 most of my php pages didnt actually work at all). I scrolled up and read the comments and tried to copy the php5srvlet.jar to tomcat/common/lib but it didnt help
- still getting java.lang.UnsatisfiedLinkError: Native Library C:\PHP\php5servlet.dll already loaded in another classloader. So it shouldn’t copy the jar to web-inf/lib this way? Because it still does. Maybe it’s got something to do with the fact that i’m using Intellij IDEA’s Tomcat integration. I’m so new to all this. Sorry if this has been mentioned in some comments above but i tried to glance through them and didnt find solution.
October 7th, 2005 at 10:38 pm
This How-To is awesome. It helped me get jump started quickly with what I needed to do. I will add this though. For anyone who is having quirky problems and you know that you have everything right try rebooting your machine. As simple as that sounds it solved the problem I have been wrestling with for the last 2 hours.
October 11th, 2005 at 9:03 pm
Some1 please help I’ve tried to install this multiple times to no avail. When i run that test page i get
displayed and thats it. Anyone know the solution for this?
October 11th, 2005 at 9:03 pm
for above
October 11th, 2005 at 9:04 pm
php phpinfo();
October 11th, 2005 at 10:22 pm
@Kevin
That is not proper php. Try this:
<?php phpinfo(); ?>
October 11th, 2005 at 10:25 pm
Thanks Rich.
October 12th, 2005 at 12:20 am
nah it was like that but it wouldnt let me post with the tags. But i got past that error, now im stuck at the
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet php threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
root cause
java.lang.UnsatisfiedLinkError: C:\PHP\php5servlet.dll: Can’t find dependent libraries
java.lang.ClassLoader$NativeLibrary.load(Native Method)
[snipped]
I have made sure there aren’t any spaces in the properties files, i recreated the jar file, ive tried restarting, tried moving the jar file to the common lib. Still got nothing
Thanks in advance
October 12th, 2005 at 6:06 am
Please double-check the instructions to ensure you have done everything as detailed. Then check the comments above for sugestions.
However first try to reboot your machine and see if it solves the problem.
October 13th, 2005 at 9:19 am
Hi all,
I wrestled with the following issue for two days and then finally found a solution to it.
I kept getting this error over and over again and tried everything that people had suggested on this site, but no use. “java.lang.UnsatisfiedLinkError: C:\PHP\php5servlet.dll: Can’t find dependent libraries”
Finally I got pissed with everything and started doing thigns the difficult way. It turned out that the solution would eventually have saved me many hours of useless configuring.
I found an application called “Dependency Walker” (go google it) and did a dependency search on the php5servlet.dll. It turned out that I was really missing one dll in my system: msjava.dll, This file I then downloaded from the http://www.dll-files.com . 。 Now EVERYTHING is running smoothly.
I hope that this post helps you guys all!
Enjoy
October 13th, 2005 at 12:13 pm
@Surtr
Did you have JDK installed in your machine? It appears that was not the case. Otherwise with JDK (and JRE) installed you shouldn’t need that dll.
October 19th, 2005 at 8:49 am
Yes,
Sorry to be this late with my answer, but here it comes anyways
I have JDK 1.5.0_05 installed. In addition have the enterprise edition on my machine for development purposes.
October 22nd, 2005 at 1:33 pm
Just thought Id publish this tip since I got these instructions pretty much working out of the chute, but ran into an issue posted above. The test.jsp page worked fine for me as phpinfo() would display correctly on my tomcat server. However, all other php pages were being output to the tomcat console window. I realized that I used the php.ini-recommended file as my php.ini, since I started to read the php installation instructions before this page. After diff’ing the two files, I found the culprit variable. Turn the setting:
output_buffering = Off
in your php.ini and all should work fine. output_buffering should be set to off.
October 26th, 2005 at 9:03 am
Might be outside the scope of this thread, but I was hoping someone might be able to point me in the right direction.
I am able to get PHP (using 5.0.5) to work with my tomcat install (5.0.28). However, for some reason I can’t get the php pages to connect to MySQL. I’ve followed directions in other posts about uncommenting the extension and where to place the php_mysql* and libmysql files, but I still get an error message about mysql_connect not being valid. Anyone have any suggestions or know of any problems with this kind of setup?
November 1st, 2005 at 7:43 am
hi, I have managed to install php on tomcat.But it doesn’t work properly.
works.But other content of a page will not be dispalyed on the browser, it is displayed on the console of tomcat:(
That is, I have a file named test.php:
hello
if I try to access it, phpinfo prints php infomation in detail, but “hello” is not showed! Instead the tomcat console prints “hello”.
I have tried phps from opensource php project( to make sure the problem is not my php file), they fail too
php version is 5.05 tomcat is t.0.28
And idea what is the problem?
November 1st, 2005 at 7:48 am
sorry, my last message doesn’t display properly.
should be:
I have a file named test.php:
[?php phpinfo();?]
hello
(I have change
November 1st, 2005 at 7:56 am
so sorry for mess it up>.
November 17th, 2005 at 1:57 pm
Can anyone who solved the “Module java already loaded” issue please post their solution.
I am abont to pull my hair out with this problem. I have gone through the steps at least a dozen time. I have removed and reinstalled java, tomcat, php, restarted the server, restarted tomcat, same problem.
I am running Tomcat 5.0.28, php 5.0.5 and jre-1_5_0_04 on win2k. I really need help with this.
java.io.IOException:
net.php.servlet.send(Native Method)
net.php.servlet.service(servlet.java:190)
net.php.servlet.service(servlet.java:214)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Thanks
Kev
November 18th, 2005 at 11:20 am
Angsuman, thanks for your wonderful guide. It’s been very useful to me.
It works right, no problems at all.
To Kevin II: I’ve got the “Module java already loaded’ error too. As I had an old PHP version, I had my php.ini in c:\windows, so when I changed to php5 I put the new php.ini in the same place. But, as you can see in point numbre 4 “Copy php.ini-dist, in c:\php, as php.ini” it must be at c:\php. I hope this will help you
November 18th, 2005 at 12:43 pm
Thanks Edur.
November 18th, 2005 at 1:11 pm
THANK YOU, THANK YOU, THANK YOU Edur…That’s the exact problem I had. I recently upgraded from an older version of PHP and the php.ini was in the WINNT directory. I moved as you suggested and it WORKS!
Thanks Angsuman for the great instructions as well. Might I add one suggestion? Can you emphasize that the php.ini should be in the directory so other dimwits like myself don’t have this problem.
November 29th, 2005 at 11:17 am
I’m seeing the ‘Module Java already loaded’ warning the first time I access a php script after restarting Tomcat. I do not get the warning again until after I restart Tomcat. I have my php.ini file in my php directory and my winnt directory and that doesn’t make a difference.
Anyone found anything else out on this issue?
December 8th, 2005 at 6:47 am
I am yet another failure with the
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
error.
Have read all the posts. Tried & checked the various solutions a number of times & in different combos [no whitespace; dll in right place; add c:\php to path; jar in common/lib; restart Tomcat; restart XP...]
I also tried starting php from the command line as per comment #51; and I got the error message:
PHP Startup: java: Unable to initialize module
Module compiled with module API=20040412
PHP compiled with module API=20041030
These options need to match
Could this be the source of the error and, if so, how do I fix it?
Thanks!
December 8th, 2005 at 10:13 am
Where is your php5servlet.dll?
Also check your jar file to ensure the location is properly specified.
December 13th, 2005 at 4:48 pm
HI,
I am trying to install php for tomcat 5.5 as mentioned in thw above steps. This is the error i am getting, not sure how to resolve it.
Error:
javax.servlet.ServletException: Wrapper cannot find servlet class net.php.servlet or a class it depends on
java.lang.ClassNotFoundException: net.php.servlet
Any help would be greatly appreciated.
Thanks
Jaya
December 13th, 2005 at 9:14 pm
Jaya,
Please refer to the comments above for clarifications. In short your jar file is not where it should be.
December 14th, 2005 at 2:38 pm
I did add the php5srvlt.jar into the webapps\applicationname\WEB-INF\lib directory and restarted tomcat5.5
But Still getting the same error:
The requested resource (Servlet php is not available) is not available.
January 9th, 2006 at 5:52 am
Thank you. Great tutorial.
I am using php-5.1.1, pecl-5.1.1 and apache-tomcat-5.5.12.
January 9th, 2006 at 6:51 pm
[...] 원문 : Running php 5.x on windows using tomcat 4.x or 5.x [...]
January 10th, 2006 at 11:25 am
I AM SO PISSD. I RESTARTED ALL - TOMCAT (5.5.12), COMPUTER (WIN2000, PHP & PECL 5.1.1), I CHANGED A LOOOT OF SETTINGS. I FOLLOWED ALL THE RULES (I HAVE NO SPACES, NO LINES, ALL THE FILES ARE PUT WHERE THEY SHOULD BE). I READ ALL YOUR POSTS OVER AND OVER AGAIN. PLEEEEEEEEEEEEEEEEEEEEASE HELP ME.
You see, the “demmo” php works just fine. prints all the information needed. but ALL other php’s give me the following error:
January 10th, 2006 at 11:28 am
by “demmo” php i meant the little php script:
[?php phpinfo();?]
January 11th, 2006 at 1:38 am
WARNING: Servlet.service() for servlet php threw exception
java.io.IOException: ? ?Ä ?¹Ü
at net.php.servlet.send(Native Method)
at net.php.servlet.service(servlet.java:190)
at net.php.servlet.service(servlet.java:214)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
[the error... sorry if this got posted twice]
January 11th, 2006 at 11:53 am
nobody?
January 11th, 2006 at 1:02 pm
Please check the comments above. I have provided solutions for this before and others have too.
It is kind of hard providing free support after over a year of the original post
Hope you understand.
January 12th, 2006 at 4:49 am
i understand. and i read it all. the problem is the solutions you guys provided don’t seem to work for me.
do you have time? cause i could enter all the stepts i’ve made. maybe you could figure something out….
January 12th, 2006 at 5:18 am
I restarted tomcat (i use tomcat v5.5). And the computer. Over and over again
NOW, the thing is test.php runs. I have a loooot of information (what strikes me here is that it doesn’t say anything about java (path, etc, etc), just jvm.dll is there. the rest is blank).
But i cannot run anything else.
You see I want to install phpbb but it’s install.php gives me the error i specified. And i developed a java applet and a php script, that script runs and then it brakes the connection from time to time. I get that error again. WHAT IS GOING ON?! PLEEEEASE HELP ME! PLEEEEEEEEEEEEEASE!!!
January 12th, 2006 at 6:37 am
@Cristi
Can you run any other code? Try this for example:
<?php echo ‘Hello World’; ?>
Let me know.
January 12th, 2006 at 6:40 am
@Cristi
Also you can contact me directly at
angsuman[at]taragana[dot]com
January 25th, 2006 at 1:02 pm
HI,
I have problem with the servlet. I’me getting a “La ressource demandée (Servlet php n’est pas disponible.) n’est pas disponible.” So I was thinking to myself, maybe I haven’t copy de php5servlet.dll onto my c:/php folder, but no… it is there. So I figured that I hadn’t change the property files to php5servlet. But then again I’ve did. Now The only thing that I have that differt from this is that I haven’t jar the class. They are under fun\WEB-INF\lib\phpsrvlt\net\php . Do you think that could be it? Fat chance cus I get a no classes found when I remove them.
January 31st, 2006 at 11:07 am
Well Hi,
I finally got the thing working. For does of you who have the _zval_dtor entrie problem. So here is what I did. I Install the 5.0.2 exacty has it is said in this article, then I took the php5servlet.dll and the php5ts.dll from the 5.1.2 version and it finally worked. Maybe I had a corrupted 0.2 version, or maybe my tomcat wasn’t acting properly, but now it’s working.
Hope it will help someone.
January 31st, 2006 at 11:14 am
Here is the stack trace for those who will search and find it
javax.servlet.ServletException: “Servlet.init()” pour la servlet php a généré une exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
java.lang.UnsatisfiedLinkError: C:\php\php5servlet.dll: La procédure spécifiée est introuvable
I beleive that you only need to change the php5servlet from the pecl5.0.2 to the pecl5.1.2 to make it work.
February 23rd, 2006 at 2:41 pm
Thanks for the walk through.
I initially had a typo in the path to the PHP installation, which led to a “no php5servlet in java.library.path”.
I then had a rather nasty message along the lines of ‘unknown entry point into php5ts.dll’, followed by a java.lang.UnsatisfiedLinkError. As Joel has mentioned above, this is an incompatability issue with different versions of PHP & PECL. I was using the latest version of PHP, 5.1.2, and PECL 5.0.2. I downloaded PHP 5.0.2 (as specified in this tutorial) and all worked fine.
February 23rd, 2006 at 2:44 pm
One other oddity: my download of PHP didn’t include an ‘ext/php_java.dll’ file. I had to copy it across from the PECL download.
Anybody else notice this?
February 28th, 2006 at 1:35 pm
HI Angsuman, It worked for PHP5.1.2 and TOMCAT 5.0.28 with out any hicups. Thanks for the Article.
March 8th, 2006 at 10:37 am
This goes for Derek:
the solution for the problem that you mention above is ver simple:
You are running PHP version 5.0.3, and the link posted in this article for downloading the Collection of PECL modules are for PECL modules version 5.0.2, so the solution is to download PECL modules 5.0.3 (pecl-5.0.3-Win32.zip) and extract the php_java.dll and overwrite the one that you have, thats all.
March 14th, 2006 at 10:28 pm
To Mr. Chakraboty and those who have commented,
Thank you for a useful tutorial. This is working perfectly for me with Tomcat 5.5.15, PHP 5.0.2, PECL 5.0.2 on Windows XP SP2.
Best,
Bryan
May 27th, 2006 at 10:04 am
I am working with:
Java SDK version “1.5.0_05″
Tomcat5.5.9
Php version 5.1.4 dated May 4 2006 10:30:29
Pecl library version 5.1.4 dated May 4 2006
I encountered several problems but now seem to be running. I unpacked class and property files from phpsrvlt.jar and php_java.jar. Here is my final configuration under Tomcat webapps
phptest - contains “test.php” file with
WEB-INF
classes
net\php\formatter.class
net\php\reflect.class
net\php\reflect.properties
contains only library=php_java trailing space removed from original
net\php\servlet.class
net\php\servlet.properties
contains only library=php5servlt ** NOTE spelling change from version in phpsrvlt.jar
In the PHP home directory
php.ini was modified to include extension=php_java.dll
php_java.dll - from the PECL distribution
php5servlt.dll - *** NOTE NAME CHANGE, was php5servlet.dll
System PATH was modified to include PHP home directory.
Next I am going to try getting Moodle running, wish me luck.
Bill
May 30th, 2006 at 2:58 am
I followed all the stages. Tomcat posts the php pages but interprete not scripts php. How I must make so that that functions? I use Tomcat 5.5 and php5.0.2 Merci
May 31st, 2006 at 8:43 pm
ok, i got tomcat using php, but i’m trying to postgres to work on the php, even though php.ini is well configurated it doesn’t work, i tried to turn on mysql also but it didn’t show up on phpinfo() either…
Angsuman, did u got any database working with tomcat+php?
it’s urgent!
thx
PS: yes, i uncommented the extensions…
May 31st, 2006 at 9:41 pm
well, i got it! i copied php.ini to the windir, normaly it wouldn’t be needed, or at list with apache isn’t, but it works…
thanks anyway…
May 31st, 2006 at 9:42 pm
least, not list, sorry…
May 31st, 2006 at 10:06 pm
I am happy to know you got it running.
June 12th, 2006 at 5:16 pm
Thanks! Angsuman, your solution works. I am using php & pecl v5.1.4, still need to modify those two properties file and put the two jars (phpsrvlt.jar & php_java.jar) under common\lib. Someone should report the properties file “bug” if they belong to the php group.
June 14th, 2006 at 12:14 am
Finally got it to work =) Got all of the errors noted above, and sure enough, after a reboot, the system works fine.
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.
June 14th, 2006 at 3:44 am
Good idea. Updated.
June 14th, 2006 at 4:30 pm
I know that the line in both reflect.properties and servlet.properties should not have a space in it… but a line break / carriage return is okay, right?
Sorry to be such a noob.
-= Dave =-
June 16th, 2006 at 12:43 pm
I have installed php 5.1.4 along with the pcl version 5.1.4. Tomcat version is 5.5.7. This is on a machine running Windows 2000.
I have a php script that basically refreshes itself / executes again every 5 minutes. And while this script worked just fine on its old server (running IIS)… and seems to work fine most of the time now in this new environment, I’m finding that Tomcat will crash / won’t stay up for more than an hour. And while this script worked just fine on its old server (running IIS)… and seems to work fine most of the time now in this new environment, I’m finding that Tomcat will crash / won’t stay up for more than an hour 。
This means I have to manually go back and restart my script.
I located the hs_err_pid*.log files that occur with each crash.
They commonly start with:
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0×486b91e4, pid=3268, tid=3692
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode)
# Problematic frame:
# C [php5ts.dll+0x91e4]
#
So, I’m guessing this is indicating that php5ts.dll is where we’re encountering some sort of problem that causes the crash. ? ?
It seems like several people here have mentioned this problem… but it’s unclear as to whether they can run PHP scripts for a while before it happens.
Is anybody else having this happen after PHP is running scripts fine for a while? Does anybody know a solution to this?
Thank you,
Dave
June 18th, 2006 at 9:50 am
Hi all,
Just a quick post to pose my problem.
Firstly, Angsuman thanks for your post and ongoing support far beyond the call.
I have followed the instructions and used information from previous posts to solve most of the problems that i have come up against but now i am stumped.
when i call my test.php file, it flashes up then my tomcat server dies and i have to restart it.
other JSP and beans and java servlets are all working fine… but i need to have php5 and this is my last stumbling block.
Once again thanks to you Angsuman as well as all the others who have contributed to this thread.
June 20th, 2006 at 6:39 pm
and java servlets are all working fine… but i need to have php5
=> php-java-bridge.sf.net
June 21st, 2006 at 3:06 pm
I installed PHP 4 on Tomcat 5 using java 5 on Linux platform. It compiled correctly but when I run php page, it shows up in catalina.out instead of the browser.
Any ideas?
June 23rd, 2006 at 6:31 am
Ok, i made it like the guide above, read all the hints, but i get only:
java.lang.UnsatisfiedLinkError: no php_java in java.library.path”
when i call the test.php ;(
I use
apache-tomcat-5.5.17
pecl-5.1.4-Win32
php-5.1.4-Win32
WinXP SP2
June 24th, 2006 at 4:48 pm
Geez, this is killing me! I can’t run a PHP application (clicking from screen to screen) for more than maybe 5 minutes!
Tomcat keeps crashing!
See my previous post (# 192).
Any recommendations?
-= Dave =-
June 25th, 2006 at 8:59 am
I hope you understand it is very hard to keep supporting this post so long down the line. The post was written in 2004.
I am closing the post for further comments. Please read the comments above. All types of problems have been addressed and solved at some time or other.
If you still need help please contact me directly using the form / email provided in the top-left corner of this page.
Best,
Angsuman