723Chapter 39PHP and JavaChapterChapter TitleVerdict?Notes7Passing Information Somewhat familiarSpecific (Web hosting compare)
723Chapter 39PHP and JavaChapterChapter TitleVerdict?Notes7Passing Information Somewhat familiarSpecific to Web-scripting. Will be between Pagesfamiliar if you have used JSP. 8StringsMostly familiarMany behavior differences andtyping concerns. 9ArraysSomewhat familiarPHP arrays share some similarities, but with different behavior. 10NumbersFamiliarPHP s two numerical types, corresponding to the long anddouble types. 11Basic PHP GotchasNovelAlmost no correlation with compiletime and runtime error checking in Java. Integrating PHP and JavaIn the course of your development work, you may run across a situation in which you will be required to use PHP and Java together, or this combination may prove advantageous forsome reason. You basically have two options to accomplish this tricky undertaking, both ofwhich are outlined below. Java environments are inherently complicated and vary accordingto servlet engine and server. Since these issues are well beyond the scope of this book, in allfurther discussions we will assume that you already have a working Web server that supportsservlets, an installed Java virtual machine (JVM), and a working familiarity with Java. The Java SAPIThe most stable solution is to integrate PHP into a Java Servlet environment using the JavaService Access Point Identifier (SAPI). This allows the PHP processor to run as a servlet andbuilds upon the PHP Java extension (described following). The servlet will run from within aJava servlet engine, such as Apache Tomcat. Though the Java servlet SAPI module will theoretically run on any of a number of availableservlet engines, the PHP team has only tested the code using Apache s Jakarta Tomcatservlet engine. Your mileage may vary if you have implemented another engine such asCaucho s Resin or IBM s WebSphere. Any environmental differences may require adjust- ments, and you are essential on your own. The PHP team encourages brave souls who tri- umph over other servlet engines to submit bugs and found fixes to the PHP DevelopmentMailing List. (See Appendix D for more information on PHP mailing lists.) Installation and setupAs with the Java extension, SAPI module support is not built into PHP by default. You willneed to rebuild PHP with the necessary options (–with-servlet-withjava) as well asany other options you may require for other uses. (See Chapter 3 for more information onNote44
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.