You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Richard A. DeVenezia" <rd...@wildblue.net> on 2005/12/03 21:24:31 UTC

Sttaus 500 when delivering PHP pages with JSR 223 Reference Implementation

My situation is that my web host processes php files using a cgi-bin/php
mechanism, which incurs a php startup cost on each php page served.  I don't
have the option of getting mod_php turned on

I do have pretty complete control over my Tomcat situation though.  Thus, I
want to try to use the JSR 223 reference implementation to deliver my php
pages from a servlet, which in theory, will keep a php processor
(libphp.so?) in memory and
deliver php generated content faster than the apache/cgi-bin situation I am
hindered with.  I would have to rename all my php pages to something like
.phpx, or .phpj, or .phptc, or .sphp to prevent the cgi-bin situation

(remove the big X's)

browse to: http://deveXnezia.coXm.wXwXw1.kc.aoindustries.com/inXfo.phpx
------
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

java.lang.NullPointerException
com.sun.script.util.ScriptEnginePool.<init>(ScriptEnginePool.java:28)
com.sun.script.util.ScriptEnginePool.<init>(ScriptEnginePool.java:39)
com.sun.script.http.ScriptServlet$EngineRepository.checkOut(ScriptServlet.ja
va:117)
com.sun.script.http.ScriptServlet.getEngine(ScriptServlet.java:85)
javax.script.http.HttpScriptServlet.service(HttpScriptServlet.java:115)

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

$  more /www/devenezia.com/webapps/ROOT/info.phpx
<? phpinfo() ?>

$ cat /proc/version
Linux version 2.6.8.1-25mdk (qateam@mercury.mandriva.com) (gcc version 3.4.1
(Mandrakelinux 10.1 3.4.1-4mdk)) #1 Tue May 31 12:00:26 MDT 2005

$ uname -a
Linux www1.kc.aoindustries.com 2.6.8.1-25mdk #1 Tue May 31 12:00:26 MDT 2005
i686 Intel(R) Pentium(R) 4 CPU 1.70GHz unknown GNU/Linux

jsr223 installed at:
/www/devenezia.com/opt/jsr223

/www/devenezia.com/conf/web.xml contains:
---------------------------------
    <servlet>
        <servlet-name>JSR223Script</servlet-name>
        <servlet-class>com.sun.script.http.ScriptServlet</servlet-class>
        <init-param>
            <param-name>script-blocks</param-name>
            <param-value>js,groovy</param-value>
        </init-param>
     </servlet>
and
    <servlet-mapping>
        <servlet-name>JSR223Script</servlet-name>
        <url-pattern>*.phpx</url-pattern>
    </servlet-mapping>
---------------------------------

My host has a browser based Control Panel (CP) for restarting Tomcat.  Some
logging indicates the tomcat process has these env vars (as setup by
startupjsr.sh)

JAVA_OPTS=-Djava.library.path=/www/devenezia.com/opt/jsr223/php5/lib
LD_LIBRARY_PATH=/usr/postgresql/7.3/lib:/usr/j2sdk/1.4.2_04/jre/lib/i386/cli
ent:/usr/j2sdk/1.4.2_04/jre/lib/i386:/usr/j2sdk/1.4.2_04/jre/../lib/i386:/us
r/postgresql/7.3/lib:/usr/postgresql/7.3/lib::/www/devenezia.com/opt/jsr223/
php5/lib/dummylib
PHPRC=/www/devenezia.com/opt/jsr223/php5/lib

Any ideas on what is needed for getting 223 reference implementation working
?
Is the source code of the ref. imp. available ?

Thanks,

Richard