从PHP调用Java方法 [英] Call Java Method from PHP
问题描述
您好,
我可以调用Java方法。这是来自php的java代码,这里是什么im
寻找我在这里有一个名为DB的类class所有DB相关的
的东西,比如数据库连接数据库插入,数据库读取等方法都是定义的。
所有即时通讯只需要调用数据库来自PHP的方法阅读
来自数据库的数据。
这里我使用支持java的phptriad2-2-1
i进行了更改" php.ini中"文件我添加了以下行来
这个文件
[更改]
java.class.path = .\ php_java.dll
java.home = C:\Program Files \ Java \ _jdk1.5.0_11
java.library = C:\Program Files \ Java \ jre1.5.0_11\bin\client\jvm.dll
java.library.path = C:\ apache \ php \ extensions \
[/更改]
她我没有php_java.jar所以我沉思php_java.dll
这里是下面简单的代码。
Hello,
can i call Java method.That is java code from php,here what i m
looking for i have class called DB in this class all the DB related
things ,like DB connection DB insert,DB read etc Methods are defined.
"All i m looking for just call the DB method from PHP that Read
data from DB".
here i m using phptriad2-2-1 that has support for java
i made changes to "php.ini" file i have added the following lines to
this file
[change]
java.class.path = .\php_java.dll
java.home = C:\Program Files\Java\jdk1.5.0_11
java.library = C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll
java.library.path = C:\apache\php\extensions\
[/change]
her i don''t have php_java.jar so i musing php_java.dll
and here is the follwing simple code.
推荐答案
BigZero schreef:
BigZero schreef:
你好,
我可以调用Java方法。这是来自php的java代码,这里是什么im
寻找我在这个类中有DB类的所有数据库相关的
的东西,比如数据库连接数据库插入,数据库读取等方法已定义。
"所有即时通讯只是从PHP调用DB方法从数据库中读取
数据。
这里我使用支持java的phptriad2-2-1
i对" php.ini中"文件我添加了以下行来
这个文件
[更改]
java.class.path = .\ php_java.dll
java.home = C:\Program Files \ Java \ _jdk1.5.0_11
java.library = C:\Program Files \ Java \ jre1.5.0_11\bin\client\jvm.dll
java.library.path = C:\ apache \ php \ extensions
Hello,
can i call Java method.That is java code from php,here what i m
looking for i have class called DB in this class all the DB related
things ,like DB connection DB insert,DB read etc Methods are defined.
"All i m looking for just call the DB method from PHP that Read
data from DB".
here i m using phptriad2-2-1 that has support for java
i made changes to "php.ini" file i have added the following lines to
this file
[change]
java.class.path = .\php_java.dll
java.home = C:\Program Files\Java\jdk1.5.0_11
java.library = C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll
java.library.path = C:\apache\php\extensions
您是否尝试过询问PHP对上述设置的看法?
尝试新的PHP脚本,仅包含:
<?php
phpinfo();
?>
你能找到吗? Javasection?路径是否正常?
我不是100%确定PHP是否自行修复,但在
路径名中使用空格时,将它们作为字符串传递是明智的,喜欢:
java.home =" C:\Program Files\Java\jdk1.5.0_11"
Hi,
Did you try asking PHP what it thinks about the above settings?
Try a new php script, only containing:
<?php
phpinfo();
?>
Can you find the Javasection? Are the paths allright?
I am not 100% sure if PHP fixes this itself, but when using spaces in
pathnames it is wise to pass them around as a string, like:
java.home = "C:\Program Files\Java\jdk1.5.0_11"
>
[/更改]
她我没有php_java.jar所以我沉思php_java.dll
>
[/change]
her i don''t have php_java.jar so i musing php_java.dll
你也确定在php.ini中也这么说了吗?
首先查看phpinfo()的内容。
问候,
Erwin Moller
And you DID make sure this is said so in php.ini too?
Check what phpinfo() says first.
Regards,
Erwin Moller
>
这里是下面的内容简单的代码。
>
and here is the follwing simple code.
好的,谢谢你
生病检查
谢谢
VM
ok thanks on that
ill check on that
Thanks
VM
你好,
i检查了phpinfo()
i认为它应该给我java表格,它提供了关于
" ODBC SQL XML的信息。 ect
但不适用于java表格
这里是来自表格格式的phpinfo()页面的示例
xml
XML支持活动
XML命名空间支持活动
EXPAT版本1.95.2
odbc
启用ODBC支持
活动持久链接0
活动链接0
ODBC库Win32
mysql
启用MySQL支持
活动持久链接0
活动链接0
客户端API版本3.23.39
等但是这个页面没有java表格做什么。
谢谢
VM
Hello,
i checked the phpinfo()
i think it should give me table for java, well it gives info about
"ODBC SQL XML" ect
but not for "java" table
here is example that came from phpinfo() page in table format
xml
XML Support active
XML Namespace Support active
EXPAT Version 1.95.2
odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.39
etc but this page don''t have the java table what to do.
Thanks
VM
这篇关于从PHP调用Java方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!