php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16402 UnsatisfiedLinkError: send when loading any php file
Submitted: 2002-04-02 22:37 UTC Modified: 2003-07-04 02:04 UTC
Votes:25
Avg. Score:4.6 ± 0.8
Reproduced:23 of 23 (100.0%)
Same Version:9 (39.1%)
Same OS:14 (60.9%)
From: csbook at adproject dot net Assigned:
Status: No Feedback Package: Servlet related
PHP Version: 4.1.2 OS: RedHat Linux
Private report: No CVE-ID: None
 [2002-04-02 22:37 UTC] csbook at adproject dot net
I've installed tomcat 4.0.2 and compiled php with the --with-servlet and --with-java options.
I've placed the jar file into my tomcat_home/libs dir, and added the libphp4.so to the LD_LIBRARY_PATH environment variable.  I've also configured web.xml, and it seems to be correct.

When I try to load any php page, tomcat throws the following internal server error, whose root cause is "UnsatisfiedLinkError: send":

javax.servlet.ServletException: Servlet execution threw an exception
	at javax.servlet.ServletException.(ServletException.java:132)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java(Compiled Code))
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java(Compiled Code))
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code))
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java(Compiled Code))
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java(Compiled Code))
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java(Compiled Code))
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java(Compiled Code))
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java(Compiled Code))
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Compiled Code))
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code))
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code))
	at org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHandler.java(Compiled Code))
	at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
	at java.lang.Thread.run(Thread.java:498)

root cause

java.lang.UnsatisfiedLinkError: send
	at net.php.servlet.service(servlet.java:162)
	at net.php.servlet.service(servlet.java:180)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java(Compiled Code))
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java(Compiled Code))
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code))
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java(Compiled Code))
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java(Compiled Code))
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java(Compiled Code))
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java(Compiled Code))
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java(Compiled Code))
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Compiled Code))
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code))
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compiled Code))
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled Code))
	at org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHandler.java(Compiled Code))
	at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
	at java.lang.Thread.run(Thread.java:498)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-15 16:25 UTC] jbennett at earthling dot net
I finally got past this error.  This is actually the secondary error.  The first page load when you start tomcat with the php servlet gives the error "no php4 in java.library.path" even though libphp4.so is in the java.library.path either via a tomcat startup directive or the env variable LD_LIBRARY_PATH.  Subsequent calls will give the unsatisfiedLinkError.  the properties files inside of phpsrvlt.jar point to php4.so, instead of libphp4.so.  I edited the properties files and rebuilt the jar and it worked.  Unfortunately I can only get a couple of page loads before tomcat crashes on me, but that's another error entirely.
 [2002-10-05 15:27 UTC] drinksi at qwest dot net
I finally found a working solution.

I had to use PHP 4.0.6.  I configured it as such "./configure --with-java --with-servlet".  I moved the phpsrvlt.jar and libphp4.so created to the "TOMCAT_HOME/common/lib" directory of Tomcat. I put the "TOMCAT_HOME/common/lib" directory in the LD_LIBRARY_PATH.  There is no need to alter the php.ini file. Works like a charm.  Hope this help.

Ivan
 [2003-07-04 02:04 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-11-25 12:10 UTC] jordi dot gou at upf dot edu
I've had the same problem. 
I installed php4.3.4 in a linux. I want to obtain php as a servlet because I want to use it in Tomcat server. So I configured it:
./configure --with-mysql=<path-mysql> --with-java=<path-java> --with-servlet

Then I execute make and copy libphp4.so in /usr/local/java/jre/lib because I read in a forum to resolve the php4 not installed error.

I also copied phpsrvlt.jar to /usr/local/tomcat/common/lib and I modified web.xml to use this servlet

Now, when I try to access to php page, the error is 

java.lang.UnsatisfiedLinkError: send
	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)
...

could anyone help me?

Thanks at all

Jordi
 [2004-08-12 08:02 UTC] okapi at yahoo dot com
I'm experiencing this with 4.3.9RC1 on Windows. I've not been able to find a solution to this.
 [2004-08-12 08:06 UTC] okapi at yahoo dot com
I copied the DLLs to C:\windows\system32 and got it to load a phpinfo() page, but then it crashed. I'll file a separate bug on that if I can't find one already.
 [2004-09-12 20:54 UTC] ijamj at cin dot ufpe dot br
I?ve figured out the solution for Windows 2000.

Just put the folder that contains "php_java.jar" in the enviroment variable "java.library.path".

java -Djava.library.path=c:\php\extensions;c:\tomcat5\common\lib

After this, copy the php_java.dll to c:\windows\system32

Works like charm!
 [2004-11-24 17:34 UTC] jgbolger at yahoo dot ie
im running tomcat-4.1.31 with php-5.0.2-Win32 and jdk-1.5.0 on a windows 2000 system.
placed phpsrvlt.jar in: jakarta-tomcat-4.1.31\common\lib

I was trying to run php as a servlet but was getting an UnsatisfiedLinkError when running a simple php file.

I finally got over this error by opening the phpsrvlt.jar file and editing the 2 properties files. The problem is it is looking for the php5servlet.dll file but this properties file was not changed from php4 where the equivalent to php5servlet.dll is phpsrvlt.
So basically, its looking for a dll that is not there, an old version of the dll. You just need to change the line 
library=phpsrvlt
to
library=php5servlet

and it will find the library. Hope this is of help to somebody
 [2006-04-28 14:34 UTC] nidget at nidget dot org
Using PHP 5.1.2 and Tomcat 5.5.17, I have a similar problem with php5servlet.dll
I have solved the issues with the name of the lib in the properties files. java.library.path is set to c:\php;c:\php\ext
Now it can find php5servlet.dll, but not one of the dependent libraries:
java.lang.UnsatisfiedLinkError: C:\php\php5servlet.dll: Can't find dependent libraries
	java.lang.ClassLoader$NativeLibrary.load(Native Method)
	java.lang.ClassLoader.loadLibrary0(Unknown Source)
	java.lang.ClassLoader.loadLibrary(Unknown Source)
	java.lang.Runtime.loadLibrary0(Unknown Source)
	java.lang.System.loadLibrary(Unknown Source)
	net.php.reflect.loadLibrary(reflect.java:34)
	net.php.reflect.<clinit>(reflect.java:29)
	net.php.servlet.init(servlet.java:157)
	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:869)
	org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	java.lang.Thread.run(Unknown Source)

I have no idea what the missing library can be.
I have tried with "Dependency Checker" and it has showed efsadu.dll was missing. I've downloaded it from the internet and copied to c:\php, but I still have the problem.
 [2006-09-02 01:06 UTC] keptos at gmail dot com
I have this problem:::::::::::::::


javax.servlet.ServletException: La ejecuci?n del Servlet lanz? una excepci?n

causa ra?z

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)

nota La traza completa de la causa de este error se encuentra en los archivos de diario de Apache Tomcat/5.5.12.



do you have any  idea?

thanks in advance
 [2006-10-06 23:53 UTC] kidala at gmail dot com
I had got the same troubles with php and tomcat (UnsatisfiedLinkError etc.).

Instructions presented on:

http://barry.cnblogs.com/default.html?page=2 or
http://blog.taragana.com/index.php/archive/running-php-5x-on-windows-using-tomcat-4x-or-5x/

are good but!!!

Problem UnsatisfiedLinkError appears because all needed dll's and php.ini aren't on path!

To solve this problem I copied:
1. php_java.dll
2. php5servlet.dll
3. php5ts.dll
4. php.ini

to C:\Windows\System32

and all running OK!!

Have fun:)
Luck
 [2007-08-10 16:33 UTC] meebosmi at yahoo dot com
Actually there's no need to copy the phpXXX.dll files with X:\WinXXX\System32 folder. Just add the PHP localtion into the path environment. Obviously you can see this is for Win32/64 systems. But, do not forget to configure CATALINA_OPTS (for tomcat 5x/+, jbossweb 1x/+) accordingly.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC