SEO Forum
 
SEO Problems SEO Knowledge Database Seo Forum Search engine optimization
  FAQ   Search   Memberlist   Usergroups   Register   Profile   Log in to check your private messages   Log in 
Tips: Integrating PHP scripts with existing Java application

 
Post new topic   Reply to topic    Seo FORUM » Client Side Programming View previous topic :: View next topic  
Tips: Integrating PHP scripts with existing Java application
 PostPosted: Thu Aug 09, 2007 5:48 am Reply with quote  
Message
  caroline

Joined: 09 Aug 2007
Posts: 23

An amazing functionality of PHP is its ability to invoke methods of existing Java objects, letting you integrate PHP into existing Java-based applications.

To employ this functionality, you need to have a Java Virtual Machine (JVM) installed on the server. If you have installed JDKs from Sun, IBM, or Black down, you will be up to the speed.

When you configure PHP, add --with-java to the configuration directives, and then change some elements of the php.ini file. The php.ini modifications are usually done by adding the following the lines:

[Java]
java.library.path=/path/to/library
java.class.path=/classpath/
extension_dir=/path/to/extensions
extension=libphp_java.so

However, that these modifications completely depend on the type of installation. Go through the README in the ext/java directory in the PHP installation directory to discover more about configuring for Java functionality.

Here is a very simple illustration of a PHP script creating a new Java object. The script will then access and print to the screen few Java properties.

<?
$system = new Java("java.lang.System");
echo "<P>Java version = " . $system->getProperty("java.version") . "<br>";
echo "Java vendor = " . $system->getProperty("java.vendor") . "</p>";
?>

These types of integration capability will be key in the future acceptance and growth of PHP, enabling more people to work on it.
 PostPosted: Wed Feb 06, 2008 5:59 am Reply with quote  
Message
  John

Joined: 11 Jan 2008
Posts: 33

Gud post Smile
 PostPosted: Thu Feb 21, 2008 7:15 am Reply with quote  
Message
  Elizabeth Enright

Joined: 20 Feb 2008
Posts: 6

A real good post.... I'm searching for the same from the last week......
Post new topic   Reply to topic    Searchenginegenie.com Forum Index » Client Side Programming

Page 1 of 1
All times are GMT

Display posts from previous:

  

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Search Engine Optimization SEO Company