如果只是在php里调用javabean的话,不需要安装tomcat.

解决方案 »

  1.   

    是JAVA内置的算法(加密字串),所以只能用JAVA来啦,要不然PHP能写一个对应的
      

  2.   

    Red Hat Linux release 7.2 (i386)
    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..