Dec 13

Finally… my Ubuntu is online

After weeks of trial and error… Finally I have my Ubuntu Gutsy Gibbon (7.10) connected to Internet :-D

Installation of Ubuntu 7.10 was extremely easy, but getting it online was a nightmare to me, but thanks to Google, I finally have it online, downloaded MP3 codec, and writing my first blog post in Linux environment… :-D

Testing mp3 codec in Linux:
U2 - Sunday Bloody Sunday

It’s 2007-12-13 07:00am now…

Oct 22

Spam

Will you buy stuffs from the shops that ask someone to shit in your house everyday?

These are the SHIT

Feb 8

Snap Preview Anywhere installed

This blog has installed with Snap Preview Anywhere for better viewing experience, whenever you move your mouse over a link that links to other website, you can preview the layout of the link you pointing to. Mouse over me to see the effect.

Jan 8

First touch on Windows Vista

I was assigned a project by company - product stability testing on Microsoft Windows Vista, so I have a chance to use Windows Vista. Although I am not a pioneer that using Windows Vista, but it’s still valuable if I could get a print screen on my first time logged in to Windows Vista. :p

My First Login to Windows Vista

Dec 28

Calling Java from PHP (on Windows XP)

Here are the steps to run Java classes from PHP

  1. Get JDK installed at your server, you can download either Java SE or Java EE from Download side of Sun website. (download Java SE if you are new, while Java EE for enterprise projects)
  2. Make sure your PHP installation folder has ‘extensions’ folder in it, it’s not available if you installed your PHP with Windows installer. If you don’t have it, download the zip package, get the ‘extensions’ folder out of zip file and paste it into PHP folder.
  3. Now you need to modify the content in php.ini (mostly available in C:\Windows)
    • search for ‘extension=php_java.dll’, uncomment it (by removing the semicolon (;))
    • go to [java] section, add these lines (or replace the commented lines with these lines):

      java.class.path = “c:\php\extensions\php_java.jar; C:\Program Files\Java\jdk1.6.0\bin; C:\Program Files\Java\jdk1.6.0\jre\lib”
      java.home = “C:\Program Files\Java\jdk1.6.0; C:\Program Files\Java\jdk1.6.0\jre\lib”
      java.library = C:\Program Files\Java\jdk1.6.0\jre\bin\server\jvm.dll
      java.library.path = “c:\php\extensions\; C:\Program Files\Java\jdk1.6.0\jre\lib”

    • Save your php.ini, restart your web server.
  4. Now create a PHP file, with the following code:

    $system = new Java(’java.lang.System’);
    echo ‘Java version installed = ‘ . $system->getProperty(’java.version’) . “<br />”;
    echo ‘Java vendor = ‘ . $system->getProperty(’java.vendor’) . “<br />”;
    echo ‘Running on server = ‘ . $system->getProperty(’os.name’) . “<br />”;

  5. Try to run the PHP script in your browser to test the connectivity.
    Calling Java methods from PHP

However now I still could not have the PHP call my own custom Java class, will update in near future when I got it run ;)

Reference: http://www.php.net/java

My environment: Windows XP with IIS, PHP 4.1.4, JDK 1.6.0

« Previous Entries Next Entries »