How To Setup PHP5 with Tomcat 5

PHP ScrewsSometimes, you want to run PHP with Tomcat. Why? Well, you may have a legacy product, for instance, that will require servlets for many more years. Or you may be using this gigantic Java program and are only interested in adding a tiny PHP piece on the side.

There are many guides showing how to do this available, but they become outdated almost as soon as they are published. So, it’s my turn to write a short-lived guide, this time for PHP 5.2.5 :)
Note thas this post relies greatly on information found here. Too bad even that guide got old so fast!

  1. Go to http://www.php.net/downloads.php and download the current version. I am going to do the setup on a Windows machine here, so I can simply download the binaries. On *nix, you will need to compile PHP. I know I will have to, anyway…
  2. You also need to download the corresponding PECL modules.
  3. Let’s assume that your current Tomcat install can be found in c:Tomcat5. Create a c:Tomcat5php directory and unzip the PHP zip file in it.
  4. Rename php.ini-dist, in c:Tomcat5php, to php.ini
  5. Extract php5servlet.dll from the PECL zip file to c:Tomcat5php
  6. Create a directory under c:Tomcat5webapps; in our case: phptest
  7. In c:Tomcat5webappsphptest, create a subdirectory: WEB-INF
  8. In c:Tomcat5webappsphptestWEB-INF, create web.xml with the following content:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
            <servlet>
                    <servlet-name>php</servlet-name>
                    <servlet-class>net.php.servlet</servlet-class>
            </servlet>
            <servlet>
                    <servlet-name>php-formatter</servlet-name>
                    <servlet-class>net.php.formatter</servlet-class>
            </servlet>
            <servlet-mapping>
                    <servlet-name>php</servlet-name>
                    <url-pattern>*.php</url-pattern>
            </servlet-mapping>
            <servlet-mapping>
                    <servlet-name>php-formatter</servlet-name>
                    <url-pattern>*.phps</url-pattern>
            </servlet-mapping>
    </web-app>
  9. Extract/unjar (using jar xvf or WinZip) php5srvlt.jar under c:Tomcat5phptmp
  10. Modify both c:Tomcat5phptmpnetreflect.properties and c:Tomcat5phptmpnetservlet.properties, replacing
    library=phpsrvlt

    with

    library=php5servlet

    and save.

  11. Jar the content of c:Tomcat5phptmp into a new version of php5srvlt.jar
  12. Move php5srvlt.jar to c:Tomcat5commonlib
  13. Copy c:Tomcat5phpphp5servlet.dll and c:Tomcat5phpphp5ts.dll to c:windowssystem32
  14. Create a test page in c:Tomcat5webappsphptesttest.php with this contents:
    <?php phpinfo(); ?>
  15. Start Tomcat and go to http://localhost:8080/phptest/test.php

It should work. If it doesn’t, you can always post the stack trace here.

Similar Posts:

If you enjoyed this post, make sure you subscribe to my RSS feed!

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Hi!!
Thanks, very nice effort.
I was successful setting up php5.2.5 / tomcat5.5 on windows xp.

One small suggestion is that in step(0 or 10), instead of jar-ing/un-jar-ing I managed by renaming the php5servlet.dll to php5srvlt.dll and got ride of the famous “Unspecified Link” exception.

A point to mention is that that “TOMCAT” does not seem use system classpath, you have to feed in -Djava.library.path(for pointing to php) when you start the service on windows.

Ha! I was wondering if merely renaming the DLL would work. Thanks!

Thanks — the test.php works fine with phpinfo(), but other scripts show nothing in the browser or in the page source. Any thoughts?

Kevin

the phpinfo works BUT if you run any other *.php file they show a blank page

I was trying to run php5 on tomcat 5.0 using the above intructions. when i opened the URL for the testpage i got the following error in the file “hs_err_pid3820″ and my webpage displayed a blank page.

Can you please help me. It is urgent.

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0×03b31e7b, pid=3820, tid=1824
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_15-b04 mixed mode, sharing)
# Problematic frame:
# C [php5ts.dll+0xa1e7b]
#

————— T H R E A D —————

Current thread (0×02f63808): JavaThread “http-8080-Processor25″ daemon [_thread_in_native, id=1824]

siginfo: ExceptionCode=0xc0000005, reading address 0×0000000a

Registers:
EAX=0×0000000a, EBX=0×009c1000, ECX=0×009c1000, EDX=0×0000000a
ESP=0×0390f3c4, EBP=0×00001505, ESI=0×00138200, EDI=0×009c1000
EIP=0×03b31e7b, EFLAGS=0×00010216

Top of Stack: (sp=0×0390f3c4)
0×0390f3c4: 030ec3f8 009c5054 0000001c 030056f8
0×0390f3d4: 009c1000 03b34e1b 030056f8 0000000a
0×0390f3e4: 009c1000 009c504c 0000003c 0390f424
0×0390f3f4: 00000002 030ec3f8 00000000 02d7a300
0×0390f404: 00000000 02d7a300 00000000 02e05bf0
0×0390f414: 03a983f1 009c2107 009c5010 0000001c
0×0390f424: 02e02f98 009c52e0 030ec3f8 009c4150
0×0390f434: 03f874c0 030ec3f8 03a970f9 00000001

Instructions: (pc=0×03b31e7b)
0×03b31e6b: ff 08 8b df bd 05 15 00 00 72 75 8b f7 c1 ee 03
0×03b31e7b: 0f be 10 8b cd 83 eb 08 c1 e1 05 03 cd 03 ca 40

Stack: [0x038d0000,0x03910000), sp=0x0390f3c4, free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [php5ts.dll+0xa1e7b]

[error occurred during error reporting, step 120, id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j net.php.servlet.startup()V+0
j net.php.servlet.init(Ljavax/servlet/ServletConfig;)V+24
j org.apache.catalina.core.StandardWrapper.loadServlet()Ljavax/servlet/Servlet;+717
j org.apache.catalina.core.StandardWrapper.allocate()Ljavax/servlet/Servlet;+75
j org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+199
j org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+285
j org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
j org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
j org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
j org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+154
j org.apache.coyote.http11.Http11Processor.process(Ljava/io/InputStream;Ljava/io/OutputStream;)V+611
j org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Lorg/apache/tomcat/util/net/TcpConnection;[Ljava/lang/Object;)V+113
j org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(Ljava/net/Socket;Lorg/apache/tomcat/util/net/TcpConnection;[Ljava/lang/Object;)V+45
j org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt([Ljava/lang/Object;)V+102
j org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run()V+167
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x03054910 JavaThread "TP-Monitor" daemon [_thread_blocked, id=2956]
0×02e90cd8 JavaThread “TP-Processor4″ daemon [_thread_in_native, id=2508]
0×030ad3b8 JavaThread “TP-Processor3″ daemon [_thread_blocked, id=3136]
0×030ad1a0 JavaThread “TP-Processor2″ daemon [_thread_blocked, id=1340]
0×030ad018 JavaThread “TP-Processor1″ daemon [_thread_blocked, id=1904]
0×03024408 JavaThread “http-8080-Monitor” [_thread_blocked, id=1520]
=>0×02f63808 JavaThread “http-8080-Processor25″ daemon [_thread_in_native, id=1824]
0×02d3ac98 JavaThread “http-8080-Processor24″ daemon [_thread_in_native, id=1916]
0×02d0fce0 JavaThread “http-8080-Processor23″ daemon [_thread_blocked, id=4036]
0×02d0f688 JavaThread “http-8080-Processor22″ daemon [_thread_blocked, id=3212]
0×031dcc70 JavaThread “http-8080-Processor21″ daemon [_thread_blocked, id=948]
0×031dc160 JavaThread “http-8080-Processor20″ daemon [_thread_blocked, id=820]
0×031db700 JavaThread “http-8080-Processor19″ daemon [_thread_blocked, id=2120]
0×02fe3060 JavaThread “http-8080-Processor18″ daemon [_thread_blocked, id=1296]
0×02fe2550 JavaThread “http-8080-Processor17″ daemon [_thread_blocked, id=1740]
0×02d439f8 JavaThread “http-8080-Processor16″ daemon [_thread_blocked, id=2036]
0×031c2218 JavaThread “http-8080-Processor15″ daemon [_thread_blocked, id=2304]
0×031c1ba8 JavaThread “http-8080-Processor14″ daemon [_thread_blocked, id=1968]
0×031c1220 JavaThread “http-8080-Processor13″ daemon [_thread_blocked, id=3164]
0×031bdd00 JavaThread “http-8080-Processor12″ daemon [_thread_blocked, id=2776]
0×0310ae38 JavaThread “http-8080-Processor11″ daemon [_thread_blocked, id=816]
0×0310a820 JavaThread “http-8080-Processor10″ daemon [_thread_blocked, id=2196]
0×03043c98 JavaThread “http-8080-Processor9″ daemon [_thread_blocked, id=2724]
0×03055da8 JavaThread “http-8080-Processor8″ daemon [_thread_blocked, id=1676]
0×030557c8 JavaThread “http-8080-Processor7″ daemon [_thread_blocked, id=3236]
0×02f62868 JavaThread “http-8080-Processor6″ daemon [_thread_blocked, id=3284]
0×03025c08 JavaThread “http-8080-Processor5″ daemon [_thread_blocked, id=420]
0×02d3fc30 JavaThread “http-8080-Processor4″ daemon [_thread_blocked, id=2356]
0×031ddc38 JavaThread “http-8080-Processor3″ daemon [_thread_blocked, id=340]
0×031dd6b0 JavaThread “http-8080-Processor2″ daemon [_thread_blocked, id=396]
0×02fe3d50 JavaThread “http-8080-Processor1″ daemon [_thread_blocked, id=4088]
0×0304a880 JavaThread “ContainerBackgroundProcessor[StandardEngine[Catalina]]” daemon [_thread_blocked, id=3460]
0×00a72e00 JavaThread “Low Memory Detector” daemon [_thread_blocked, id=1004]
0×00a719e8 JavaThread “CompilerThread0″ daemon [_thread_blocked, id=2736]
0×00a70b38 JavaThread “Signal Dispatcher” daemon [_thread_blocked, id=3036]
0×00a6bba8 JavaThread “Finalizer” daemon [_thread_blocked, id=1040]
0×00a6a760 JavaThread “Reference Handler” daemon [_thread_blocked, id=1404]
0×00036da8 JavaThread “main” [_thread_in_native, id=716]

Other Threads:
0×00a47ac8 VMThread [id=2692]
0×00a74040 WatcherThread [id=2916]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 576K, used 430K [0×24020000, 0×240c0000, 0×24500000)
eden space 512K, 71% used [0×24020000, 0×2407b8a8, 0×240a0000)
from space 64K, 99% used [0×240b0000, 0×240bfff8, 0×240c0000)
to space 64K, 0% used [0×240a0000, 0×240a0000, 0×240b0000)
tenured generation total 6132K, used 3827K [0×24500000, 0×24afd000, 0×28020000)
the space 6132K, 62% used [0×24500000, 0×248bce00, 0×248bce00, 0×24afd000)
compacting perm gen total 8192K, used 4672K [0×28020000, 0×28820000, 0×2c020000)
the space 8192K, 57% used [0×28020000, 0×284b0078, 0×284b0200, 0×28820000)
ro space 8192K, 67% used [0×2c020000, 0×2c582410, 0×2c582600, 0×2c820000)
rw space 12288K, 47% used [0×2c820000, 0×2cdcf748, 0×2cdcf800, 0×2d420000)

Dynamic libraries:
0×00400000 – 0×0040d000 C:\Program Files\Java\jdk1.5.0_15\bin\java.exe
0×7c900000 – 0×7c9b0000 C:\WINDOWS\system32\ntdll.dll
0×7c800000 – 0×7c8f5000 C:\WINDOWS\system32\kernel32.dll
0×77dd0000 – 0×77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0×77e70000 – 0×77f02000 C:\WINDOWS\system32\RPCRT4.dll
0×77fe0000 – 0×77ff1000 C:\WINDOWS\system32\Secur32.dll
0×77c10000 – 0×77c68000 C:\WINDOWS\system32\MSVCRT.dll
0×6d740000 – 0×6d8de000 C:\Program Files\Java\jdk1.5.0_15\jre\bin\client\jvm.dll
0×7e410000 – 0×7e4a0000 C:\WINDOWS\system32\USER32.dll
0×77f10000 – 0×77f57000 C:\WINDOWS\system32\GDI32.dll
0×76b40000 – 0×76b6d000 C:\WINDOWS\system32\WINMM.dll
0×76390000 – 0×763ad000 C:\WINDOWS\system32\IMM32.DLL
0×10000000 – 0×10015000 C:\WINDOWS\system32\APSHook.dll
0×77f60000 – 0×77fd6000 C:\WINDOWS\system32\SHLWAPI.dll
0×77c00000 – 0×77c08000 C:\WINDOWS\system32\VERSION.dll
0×76bf0000 – 0×76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0×6d300000 – 0×6d308000 C:\Program Files\Java\jdk1.5.0_15\jre\bin\hpi.dll
0×6d710000 – 0×6d71c000 C:\Program Files\Java\jdk1.5.0_15\jre\bin\verify.dll
0×6d380000 – 0×6d39d000 C:\Program Files\Java\jdk1.5.0_15\jre\bin\java.dll
0×6d730000 – 0×6d73f000 C:\Program Files\Java\jdk1.5.0_15\jre\bin\zip.dll
0×6d540000 – 0×6d553000 C:\Program Files\Java\jdk1.5.0_15\jre\bin\net.dll
0×71ab0000 – 0×71ac7000 C:\WINDOWS\system32\WS2_32.dll
0×71aa0000 – 0×71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0×71a50000 – 0×71a8f000 C:\WINDOWS\system32\mswsock.dll
0×662b0000 – 0×66308000 C:\WINDOWS\system32\hnetcfg.dll
0×71a90000 – 0×71a98000 C:\WINDOWS\System32\wshtcpip.dll
0×009c0000 – 0×009c8000 C:\WINDOWS\system32\php5servlet.dll
0×03a90000 – 0×03fb2000 C:\WINDOWS\system32\php5ts.dll
0×77120000 – 0×771ab000 C:\WINDOWS\system32\OLEAUT32.dll
0×774e0000 – 0×7761d000 C:\WINDOWS\system32\ole32.dll
0×74320000 – 0×7435d000 C:\WINDOWS\system32\ODBC32.dll
0×5d090000 – 0×5d12a000 C:\WINDOWS\system32\COMCTL32.dll
0×7c9c0000 – 0×7d1d6000 C:\WINDOWS\system32\SHELL32.dll
0×763b0000 – 0×763f9000 C:\WINDOWS\system32\comdlg32.dll
0×773d0000 – 0×774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
0×20000000 – 0×20017000 C:\WINDOWS\system32\odbcint.dll

VM Arguments:
jvm_args: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=D:\apache-tomcat-5.5.26\conf\logging.properties -Djava.endorsed.dirs=D:\apache-tomcat-5.5.26\common\endorsed -Dcatalina.base=D:\apache-tomcat-5.5.26 -Dcatalina.home=D:\apache-tomcat-5.5.26 -Djava.io.tmpdir=D:\apache-tomcat-5.5.26\temp
java_command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.5.0_15
JRE_HOME=C:\Program Files\Java\jdk1.5.0_15
CLASSPATH=C:\Program Files\Java\jdk1.5.0_15\lib\tools.jar;D:\apache-tomcat-5.5.26\bin\bootstrap.jar
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\HPQ\IAM\bin;D:\Work\php
USERNAME=asha
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 15 Model 36 Stepping 2, AuthenticAMD

————— S Y S T E M —————

OS: Windows XP Build 2600 Service Pack 2

CPU:total 1 (cores per cpu 1, threads per core 1) family 15 model 36 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, mmxext, 3dnowext, 3dnow

Memory: 4k page, physical 392560k(51600k free), swap 942556k(394852k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_15-b04) for windows-x86, built on Feb 9 2008 01:07:28 by “java_re” with MS VC++ 6.0

@asha It’s a JVM crash. That’s always bad news. Try upgrading to a more recent version of Java, this issue may have been patched by Sun.

@Kevin & @shorif Do you have an example of PHP code that fails this way? Does it make a difference it you start your scripts with error_reporting(E_ALL)?

Tomcat doesn’t seem to fill in the _SERVER variables except for REQUEST_TIME, argv and argc. argv is an empty array. I’d like to get the various kinds of HTTP information such HTTP_USER_AGENT, HTTP_REFERER, etc. Is there anything to do? I prefer using Tomcat.

I get a ClassNotFoundException on net.php.servlet. What library or jar file is that supposed to be in?

Step 9 talks about unjarring php5srvlt.jar. In the pecl-5.2.5-win32.zip file I downloaded the name is phpsrvlt.jar. Has anyone gotten the steps to work using this jar file? Just curious why the 2 properties files haven’t been updated – the original instructions referred at the top have a date of 12/11/2004. thx!

I answered my own question (post 8). The ClassNotFoundException I had with net.php.servlet was due to an incorrect re-jarring on my part.

Try quercus from caucho instead. easier integration, just add the jar in the WEB-INF/lib and you are done.

On any nonexisting .php page request Tomcat (actually JVM) fails with error:
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0×6da22074, pid=3224, tid=3708
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode, sharing windows-x86)
# Problematic frame:
# V [jvm.dll+0x1b2074]
#
# An error report file with more information is saved as:
# C:\tomcat\bin\hs_err_pid3224.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp

Am I the only one with this problem? :)

Hey all!

I think I’m messing up the re-jarring of the php5srvlt.jar file.

Could someone give me a brief run down on how I’m supposed to do this? I’ve tried a few different ways but they all keep outputting a “java.lang.ClassNotFoundException: net.php.servlet” error.

Cheers.

Dan

All good, sorted it out.

I ended up renaming the php5servlet.dll to php5srvlt.dll and didn’t bother rejarring, works a treat.

Thanks for the great article.

Could post a linux version of this guide, and could you be specific about which PECL modules to use?

Justin

Mārtiņš:::

It isn’t just you.
I get the same problem. Request a .php page that doesn’t exist and *bang* the JVM crashes and the Tomcat service explodes. (Thankfully windows service recovery options bring the service back up with only 1 min of downtime)

I’m still hunting for a way to fix this… it’s quite silly that type-o’s bring the webserver down.

hi i am getting this error after running php prg.why?after i have configure all

HTTP Status 404 – /fun/test.php

cofiguratuon:
# Go to http://www.php.net/downloads.php and download the current version. I am going to do the setup on a Windows machine here, so I can simply download the binaries. On *nix, you will need to compile PHP. I know I will have to, anyway…
# You also need to download the corresponding PECL modules.
# Let’s assume that your current Tomcat install can be found in c:\Tomcat5\. Create a c:\Tomcat5\php\ directory and unzip the PHP zip file in it.
# Rename php.ini-dist, in c:\Tomcat5\php\, to php.ini
# Extract php5servlet.dll from the PECL zip file to c:\Tomcat5\php\
# Create a directory under c:\Tomcat5\webapps\; in our case: phptest
# In c:\Tomcat5\webapps\phptest\, create a subdirectory: WEB-INF
# In c:\Tomcat5\webapps\phptest\WEB-INF\, create web.xml with the following content:

php
net.php.servlet

php-formatter
net.php.formatter

php
*.php

php-formatter
*.phps

# Extract/unjar (using jar xvf or WinZip) php5srvlt.jar under c:\Tomcat5\php\tmp\
# Modify both c:\Tomcat5\php\tmp\net\reflect.properties and c:\Tomcat5\php\tmp\net\servlet.properties, replacing

library=phpsrvlt

with

library=php5servlet

and save.
# Jar the content of c:\Tomcat5\php\tmp\ into a new version of php5srvlt.jar
# Move php5srvlt.jar to c:\Tomcat5\common\lib\
# Copy c:\Tomcat5\php\php5servlet.dll and c:\Tomcat5\php\php5ts.dll to c:\windows\system32\
# Create a test page in c:\Tomcat5\webapps\phptest\test.php with this contents:

Reply plz…..

Oh, man! So easy! What a great post. Shame that some people had trouble with it, but that’s often the case with setting up servers and such I guess.
I’ll have to try this when I get back to it :)

One thing I recommend for people having problems is CHECK THE VERSIONS! This article was posted almost a year ago. It may not seem like very long but one little change in either Tomcat or PHP can break the whole procedure, so it’s important that the versions people use following your instructions actually match what you did (or close enough).

Maybe won’t help anybody but always worth checking.

I am trying to run PHP 5.2.28 on Tomcat 5.5 on Fedora Core4. I also want some way to share session between PHP and Java programs. Please advice.

Hi
According to given setup instruction only phpinfo(); is working. When I am trying to execute any other .php file say I want to echo ‘Hello World’, It is showing blank page.

Hi!.

Has anybody resolve the blank page problem?.

I`ve try a lot of ways to resolve this but when I open a php page and click on a

button.submit() in browser I get a blank page, it´s driving me crazy!!!.

For example: in joomla administrator the login page seems to view correctly but

when I click on Login button a blank page is displayed.

Any idea?

Thanks!.
Paco.

I have found this error when you try to run test.php page

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:729)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.
what the solution, please
thanks for help.

test.php work correctly but others *.php not work and don’t show anything why?

@rizeq

So, at first test.php didn’t work but then it did, and now other pages are not working? What did you do to ‘unglue’ test.php?

I haven’t played with Tomcat + PHP in a while but I would make sure that access rights are similar to that of test.php (of course these settings depend on which version of Windows you are running and I’m not a Windows guru…)

Originally Posted By rizeqI have found this error when you try to run test.php page

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:729)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.
what the solution, please
thanks for help.

——-

I have the same problem. Did you solve this problem? If it’s true can you help me please?

1. If you see a blank page:
Check the page’s source code. Does it, by any chance, contain your whole PHP source? If so, make sure that the PHP tags you are using are recognized by Tomcat.

2. UnsatisfiedLinkError:
Could be due to looking for your php file in the wrong place. Try moving it from webapps\ to webapps\ROOT\

I solved the problem! It is needed to move all my pages into ROOT. Thanks Chris!!

Now, I’m having some problems with the use functions of PHP. I suppose that is due to extension folder link. I’m fighting with php-java-bridge and I some functions are not detected. eg. request_functions. In phpinfo() I can see that the extensions are includeed….

See you soon.

Sorry but im a bit confused. Is it okay to run php 5.x and tomcat 6? Is there any conflict with this?

Hi,
I now moved my php files to /ROOT but it displaying blank page. using this code “” in test.php. Any magical advice?

Thank you

In setting up tomcat5.x and php5.x is there a problem implementing it on windows vista? please help! thanks

Dear all, I’m currently using WAMP to execute php, its workin g well, i want to work in tomcat, can any one explain clearly, wher to download, store and execute php file. thanks to any one.

Leave a comment

(required)

(required)


data recovery