note 64665 added to ref.java

From: Date: Wed, 19 Apr 2006 15:06:28 +0000
Subject: note 64665 added to ref.java
Groups: php.notes 
Request: Send a blank email to php-notes+get-108627@lists.php.net to get a copy of this message
Workaround for Win32 / Apache / PHP4 users that do not wish to switch from SAPI to CGI : Java Bridge is a great project, and it's too bad I *have* to upgrade to php5 to see it working. One more reason not to use php5. I have a production server running a few intranet applications and other php utilities, on a w2k platform with Apache-1.3.33 and php-4.3.10. I need to have java working along with php on this production server, and I do not wish to upgrade all php applications to php5, nor do I wish to switch to Apache2 to get php4 and php5 running together. So my choice went to ext/php_java. Of course I've had the usual issues ... "Fatal error: Unable to Create Java Virtual Machine" Basically the workaround for this thread issue is to " use CGI instead of SAPI " But CGI is slower than SAPI, what about performances for all my applications ? Well there is a (clumsy) solution : use both CGI and SAPI, keeping SAPI for the regular php work, and creating a new mime type and extension in the httpd.conf for the php files invoking java. I chose to use the '.jhp' extension (yeah, sounds horrible but still, it's nicer than '.phava'), here's a copy of my settings : my php.ini : -------------- [Java] extension=php_java.dll java.class.path = C:\php4-Win32\extensions\php_java.jar java.home = c:\jdk-1.5 java.library = c:\jdk-1.5\jre\bin\server\jvm.dll my httpd.conf : ------------------ ScriptAlias /jhp/ "C:/php4-Win32/" AddType application/x-httpd-jhp .jhp Action application/x-httpd-jhp /jhp/php.exe The Server : -------------- Windows 2000 (fr) SP4 Apache/1.3.33 (Win32) Php 4.3.10 (SAPI + CGI) Java version=1.5.0_06 ---- Server IP: 217.174.203.10 Probable Submitter: 194.98.232.203 ---- X-Spam-Status: Yes, hits=5.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, NEW_DOMAIN_EXTENSIONS autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/ref.java.php Edit -- http://master.php.net/note/edit/64665 Del: integrated -- http://master.php.net/note/delete/64665/integrated Del: useless -- http://master.php.net/note/delete/64665/useless Del: bad code -- http://master.php.net/note/delete/64665/bad+code Del: spam -- http://master.php.net/note/delete/64665/spam Del: non-english -- http://master.php.net/note/delete/64665/non-english Del: in docs -- http://master.php.net/note/delete/64665/in+docs Del: other reasons-- http://master.php.net/note/delete/64665 Reject -- http://master.php.net/note/reject/64665 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#108627) next »