|
Posted by ybakos on 08/04/06 16:45
If your project isn't too far along the best experience I've had with
Java and PHP interop is with Caucho Resin. Very fast, very stable, can
create server-side code in Java, JS, PHP, with simple Java-based PHP
extension mechanisms. Really good stuff.
Cheers,
Yong
IchBin wrote:
> Colin McKinnon wrote:
> > IchBin wrote:
> >
> >> I am trying to get Java to work from within PHP. I have been looking at:
> >> http://us2.php.net/java
> >>
> >> The error and line of PHP code:
> >> $system = new Java('java.lang.System');
> >>
> >> Fatal error: Class 'Java' not found in C:\Documents and Settings\Ed
> >> Taylor\My Documents\Projects Eclipse\workspaces\workspace
> >> PHP\Scrapboard\JavaExample.php on line 3
> >>
> >
> > PHP can't find a class definition - the PECL extension isn't loaded. You can
> > confirm this using phpinfo()
> >
> >> This is what I have defined in my PHP.ini:
> >>
> >> extension=php_java.dll
> >>
> >> java.class.path = "C:\php5.2\ext\php_java.jar"
> >> java.home = "C:\Program Files\Java\jdk1.5.0_07"
> >> java.library = "C:\Program
> >> Files\Java\jdk1.5.0_07\jre\bin\server\jvm.lib"
> >> java.library.path = "C:\php5.2\ext"
> >>
> >
> > Not used the Java wrapper - typically if PHP can't load an extension it
>
> Not sure what you mean when you say you have not used the Java wrapper?
> Is there some other way of running Java from with in PHP? This is the
> only way I have found how to do it.
>
> > tells you (You may need to crank up the default volume on error reporting):
> > PHP Warning: PHP Startup: Unable to load dynamic library
> > '/usr/lib/php5/extensions/libnonesuch.so'
> > - /usr/lib/php5/extensions/libnonesuch.so: cannot open shared object file:
> > No such file or directory in Unknown on line 0
>
> I have changes some of the Error recording parms and when I start Apache
> or run a command line I get the following error:
>
> C:\>php-cgi
> PHP Warning: PHP Startup: java: Unable to initialize module
> Module compiled with module API=20050922, debug=0, thread-safety=1
> PHP compiled with module API=20060613, debug=0, thread-safety=1
> These options need to match
> in Unknown on line 0
> <br />
> <b>Warning</b>: PHP Startup: java: Unable to initialize module
> Module compiled with module API=20050922, debug=0, thread-safety=1
> PHP compiled with module API=20060613, debug=0, thread-safety=1
> These options need to match
> in <b>Unknown</b> on line <b>0</b><br />A
>
> >
> > HTH
> >
> > C.
>
> The error does not say it can not load it but it can not initialize it.
> Just wondering what the difference is and what I am missing. It has to
> be a link in the PHP.ini. I'll go back over it with give it another try.
>
> Thanks in Advance...
> IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
> __________________________________________________________________________
>
> 'If there is one, Knowledge is the "Fountain of Youth"'
> -William E. Taylor, Regular Guy (1952-)
Navigation:
[Reply to this message]
|