(keitai-l) BrowserHawk and PHP

From: Richard Fox <rfox_at_sbsii.com>
Date: 02/28/02
Message-ID: <MIEHKIDIFLKLBIMKHEMFIELBCAAA.rfox@sbsii.com>
Hi,

I was read with interest your exchange on PHP and Browserhawk, and I wonder
if you could give me some advice... I have Java running on my LAMP box and
can instantiate Java classes from my PHP script, also phpinfo() returns a
Java section, so I know I have a working JVM but I have not added servlet
support (yet). According to available docs, I should be able to run
BrwoserHawk now from PHP, I tried the following:

<?php

$system = new Java("java.lang.System");

print "Java version=".$system->getProperty("java.version")." <br>\n";
print "Java vendor=".$system->getProperty("java.vendor")." <p>\n\n";
print "OS=".$system->getProperty("os.name")." ".
              $system->getProperty("os.version")." on ".
              $system->getProperty("os.arch")." <br>\n";

$formatter = new Java("java.text.SimpleDateFormat","EEEE,
                        MMMM dd, yyyy 'at' h:mm:ss a zzzz");
print $formatter->format(new Java("java.util.Date"))."<br>\n\n<br>";

$bhawk = new Java("com.cyscape.browserhawk.BrowserHawk");
$bhinfo = $bhawk->getBrowserInfo("HTTP_USER_AGENT");
if ($bhinfo->getFileUpload() == True)
        print "Browser is upload capable!<br>";
else
        print "Browser is not capable of uploads!<br>";

phpinfo();
?>


What happens? I get "Page Cannot be Displayed". Take the BrowserHawk code
out, works fine.

My PHP.INI

[Java]
java.class.path =
/usr/local/lib/php/php_java.jar:/usr/local/BrowserHawk/lib/bha
wk4j.jar:/usr/local/BrowserHawk
;java.class.path = /usr/local/lib/php/php_java.jar
java.home = /usr/java/j2sdk1.4.0
java.library = libjava.so
java.library.path = /usr/local/lib/php/extensions/no-debug-non-zts-20010901
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20010901
extension = libphp_java.so

and, my /etc/profile

  PATH="$PATH:/usr/java/j2sdk1.4.0/bin:/usr/java/j2sdk1.4.0/jre/bin"
  JAVA_HOME="/usr/java/j2sdk1.4.0"
  NPX_PLUGIN_PATH="/usr/java/j2sdk1.4.0/plugin/i386/ns4"

LD_LIBRARY_PATH="/usr/java/j2sdk1.4.0/jre/lib/i386:/usr/java/j2sdk1.4.0/jre/
lib/i386/server:/usr/local/lib/php:/usr/local/BrowserHawk/lib"
  CLASSPATH="/usr/local/BrowserHawk/lib/bhawk4j.jar:/usr/local/BrowserHawk"

Any advice at all?

TIA,

Rich
Received on Thu Feb 28 20:37:33 2002