如果只是在php里调用javabean的话,不需要安装tomcat.
解决方案 »
- 如何生成个类似TREE结构的数组?
- 关于字符串的一个算法请教
- 用php发送邮件,时而成功,时而失败。。。
- 数组$_gc=1 2 3 我现在加了,号变成了1,2,3, 最终需求是1,2,3 请问怎么做
- 如何判断是否是蜘蛛?
- 高手入内!如何特别指定HTML中的标签,使之不能被htmlencode转换到其他字符??
- 需要从比较稳定的新闻源获取新闻,请问用著名网站的滚动新闻好,还是用新闻组(nntp协议连接)的好?
- phpmyadmin怎么设置才能让他不是直接进入页面,而是跳出一个用户名和密码输入框,正确了才能进入?
- 请帮我解决一个简单的问题,谢谢
- 急!!!phpmyadmin访问被拒绝
- 怎么样判断输入的是不是数字?
- 在PHP里面,如何检查一个远程文件是否存在?
apache 1.3.27
php 4.2.3
j2sdk1.4.2I followed all the notes in this thread and managed to get it to work for the system described above.
Apache kept hanging until I added pthreads to the apache build.
So all in one place the things u need to get it working for the system noted above.
It follows on from all the hard work/effort from the previous posts (thanks guys!!!),
i take no credit - this just an extra bit of help..Apache
--------
Apache needs pthreads, you can do it before the configure command, ie:
LDFLAGS=-lpthread ./configure --prefix=/www/web1 \ etc etcAfter it is installed, edit apachectl and add at the top somewhere:
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/serverI tried to add those paths to /etc/ld.so.conf (and running ldconfig -v)
but a test php page with:
echo "<PRE>";
system("ldd /usr/java/j2sdk1.4.2/jre/lib/i386/*")
showed many "not founds"
therefore I stuck with the LD_LIBRARY_PATH
ran it again and all was ok - all the libraries resolved ok.
Setting the LD_LIBRARY_PATH correctly should dissolve all errors such as:
Cannot instantiate non-existent class:
cannot open shared object file:
Unable to load Java LibraryPHP
----
Compile with
--with-java=PATH_TO_JAVA_HOME
mine is:
--with-java=/usr/java/j2sdk1.4.2php.ini settings - mod for your paths/versions
-----------------
[java]
java.class.path=/www/web1/conf/lib/php/php_java.jar
java.home = /usr/java/j2sdk1.4.2
java.library = /usr/java/j2sdk1.4.2/jre/lib/i386/libjava.so
java.library.path = /www/web1/conf/lib/php/extensions/no-debug-non-zts-20020429
extension_dir = /www/web1/conf/lib/php/extensions/no-debug-non-zts-20020429
extension=libphp_java.sotest
-----
make a test php page
just write:
<?phpinfo() ?>
then save and browse to it.
check the java section to see if your php.ini settings are sethack
-----
Finally, in the java.library.path dir where java.so lives
run the command
ln -s java.so libphp_java.soedit a test file with the java code in at the top of this thread and all should b okany errors in the error_log - check that the LD_LIBRARY_PATH is really setsorry if i have missed anything out
mail me a slap :O)
but its been an awful day today!
G00dLucK,
ells..