Another trick of PHP's efficacy is its ability to call methods of existing Java objects. This function allows you to integrate PHP into existing Java-based exploitation programs. If you are promoting PHP in your work, you can find the best features that can be blown up. another top trick of PHP is its ability to call methods of existing Java objects, this function allows you to integrate PHP into existing Java-based exploitation programs. If you are promoting PHP in your work, you can find the perfect spot. you know, Java is everywhere.
To use this function, you need to install the Java virtual machine (JVM) on the server ). If you plan to install (or have installed) JDK from Sun, Kaffe, IBM, or Blackdown, you are now on the right path.
When you configure PHP, you need to add the -- with-java parameter to the configuration command, and then modify your php. ini file. In php. ini, the following lines are usually corrected:
[Java]
Java. library. path =/path/to/library
Java. class. path =/classpath/
Extension_dir =/path/to/extensions
Extension = libphp_java.so
However, please note that the above corrections depend on your installation type. You should browse the README file in the ext/java directory under your PHP installation directory to learn more about Java function settings.
The following is a simple example: Create a PHP script for a new Java object. The script will then obtain some Java attributes and print them out. This is also a good example of COM.
$ System = new Java ('Java. lang. system ');
Echo'
Java version = '. $ system-> getProperty ('Java. version ').'
';
Echo 'Java vendor = '. $ system-> getProperty ('Java. upload ').'
';
?>
If you have mastered the Java knowledge, you must help developers to do a good job in this project. These types of integration functions must be the key to PHP development and human reception in the future. Therefore, the future of PHP will be even better if more people are doing such work.