|
Posted by IchBin on 09/27/46 11:54
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
> 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
>
> HTH
>
> C.
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? I do not mean
PHP from with in Java. This is the only way I have found how to do it.
I did not see anything related to Java in the phpinfo(). I do have two
file in the .ext subdirectory:
php_java.jar
php_java.dll
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
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.
Keeping my feet in Java and new to PHP I think that this should be
top-down process to implement. The user comments in the extended PHP
manual for Java does not give me much of a secure feeling.
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]
|