You are here: Re: PHP and Java « PHP Programming Language « IT news, forums, messages
Re: PHP and Java

Posted by Jerry Stuckle on 12/17/23 11:54

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

It means the Java wrapper and PHP have been compiled against two
different versions of Apache API. You'll either need to find matching
versions or compile your own.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация