You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Anderson <mu...@swiftdsl.com.au> on 2004/11/29 08:05:16 UTC

PHP to run under Tomcat

Hi All,

I was wondering if any of you could help me with some Tomcat administration.
I am trying to configure Tomcat (and according to the specs on apache.org it
can be done) to use PHP and I don't want to have Apache handling PHP and
Tomcat handling JSP I would like the Tomcat to handle both. I have done the
following

I installed PHP4
I set the environment variable PHP_HOME to c:\php as this was where I
installed it
I moved phpsrvlt.jar from c:\php\sapi\ to the common\lib directory
I added in the following lines in web.xml

<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>

I renamed the php.ini-dist to php.ini in c:\php
I then modified the following lines
extension_dir = .\	->	extension_dir = "C:\php\extensions"
;extension=php_java.dll	->	extension=php_java.dll

[Java]
java.class.path = C:\php\extensions\php_java.jar
java.home = C:\j2sdk1.4.0-rc\
java.library = C:\j2sdk1.4.0-rc\jre\bin\client\jvm.dll
java.library.path = .\

Now my I am using
Windows 2000 Server for the OS
Jakarta Tomcat 5.0.27
php-4.3.9-Win32


The error message I seem to get is
java.lang.UnsatisfiedLinkError: no php5servlet in java.library.path
	java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
	java.lang.Runtime.loadLibrary0(Runtime.java:772)
	java.lang.System.loadLibrary(System.java:832)
	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:117
)
	org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:702)
	org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:644)

and if I hit refresh on the same page I get the following different error
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:810)

Why I get two different errors is beyond me. I have done ALOT of research
into finding the solution to this and I find there are many people who have
come across the same problem but noone has a solution. Has anyone managed to
get PHP to work under Jakarta Tomcat and can anyone see what I am doing
wrong? Thank you all so much for your time and I thank you in advance.

Kindest Regards,
Matt Anderson


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org