LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to configure PHP-4.4 with TomCat-5 on Fedora Core 1? (http://www.linuxquestions.org/questions/linux-software-2/how-to-configure-php-4-4-with-tomcat-5-on-fedora-core-1-a-494750/)

chillyroll 10-22-2006 11:45 PM

How to configure PHP-4.4 with TomCat-5 on Fedora Core 1?
 
Hi guys,
I am having some configuration problem of PHP 4.4.4 with Tomcat 5.0.28. I tried many HotTo's but nothing worked. Can you guys help me out?

From many search results, I came to know that there are 2 solutions to it. One is to configure PHP with Apache and then include connectors between Apache and TomCat. And second one is to configure PHP with Tomcat itself. I am looking for the second solution.

Thanks in advance.

paulsm4 10-23-2006 12:05 AM

Hi -

PHP has nothing directly to do with Tomcat (the Java Servlet container).

If you want to use both PHP and Tomcat with Apache, you should:

1. Build Apache with PHP support
2. Download and install an appropriate JDK (Sun's latest Java 1.5.x is probably your best choice)
3. Download, install and configure Tomcat to use your Apache with your JDK

This is probably your best resource for item 3:
http://wiki.apache.org/tomcat/HowTo

'Hope that helps .. PSM

PS:
My statement above is absolutely true:
Quote:

PHP has nothing directly to do with Tomcat
However, I don't know if you've already come across and tried this link:
http://wiki.apache.org/tomcat/UsingPhp

chillyroll 10-23-2006 12:28 AM

Thanks "paulsm4" for your quick reply! But......
 
Hi paulsm4,
First of all thanks for your QUICK reply.

I have already tried wiki.apache.org/tomcat/UsingPhp but it failed. When run following commands ==>

./configure --with-servlet=$TOMCAT_HOME --with-java=$JAVA_HOME

make

sapi/servlet/phpsrvlt.jar and libs/libphp4.so are supposed to be created but they have not. Also I did not get what is the PHP patch at the begining of that doc. How should I use it. And I guess that patch is also not complete.

I will again try to follow this procedure and lets hope all goes fine.

Meanwhile, can you please refer to that doc once again and suggest if I am wrong.

Also to inform you that I have already configured Tomcat. Also my PHP is working absolutely fine with Apache2, but I want to run it with Tomcat.

Thanks in advance.

paulsm4 10-23-2006 02:58 PM

The main suggestions I can make is to redirect your "make" output, and check for errors (i.e. figure out why phpsrvlt.jar and libs/libphp4.so either didn't get built, or didn't get installed where you expected them:
Quote:

Instead of "make", try something like:
make 2>&1 make.err

Then, when it's done:
less make.err
Also: "make" (building the binaries) and "make install" (copying the binaries from your build directory) are usually two separate steps. Do you think maybe these files got *built* (in your sandbox), but never got *installed* (where you actually needed them)?

Just a thought .. PSM

chillyroll 10-23-2006 11:49 PM

Hi paulsm4,
I have configured PHP with Tomcat on Fedora Core 1 successfully. Thanks to you, but when I run any PHP script I get following error message(s).

----------------------------

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.init() for servlet php threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.jav a:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)

root cause

java.lang.UnsatisfiedLinkError: /root/php-4.4.4/libs/libphp4.so: /root/php-4.4.4/libs/libphp4.so: undefined symbol: ts_resource_ex
java.lang.ClassLoader$NativeLibrary.load(Native Method)
java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511)
java.lang.Runtime.loadLibrary0(Runtime.java:788)
java.lang.System.loadLibrary(System.java:834)
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:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.jav a:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:534)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
Apache Tomcat/5.0.28


------------------------

For your reference my Java, PHP and Tomcat paths are

/usr/local/jakarta-tomcat-5.0.28
/usr/java/j2sdk1.4.2_12
/root/php-4.4.4

Thanks in advance.


All times are GMT -5. The time now is 06:01 PM.