write down,forget
adidas eqt support ultra primeknit vintage white coming soon adidas eqt support ultra boost primeknit adidas eqt support ultra pk vintage white available now adidas eqt support ultra primeknit vintage white sz adidas eqt support ultra boost primeknit adidas eqt adv support primeknit adidas eqt support ultra boost turbo red white adidas eqt support ultra boost turbo red white adidas eqt support ultra boost turbo red adidas eqt support ultra whiteturbo adidas eqt support ultra boost off white more images adidas eqt support ultra boost white tactile green adidas eqt support ultra boost beige adidas eqt support ultra boost beige adidas eqt support refined camo drop adidas eqt support refined camo drop adidas eqt support refined running whitecamo adidas eqt support 93 primeknit og colorway ba7506 adidas eqt running support 93 adidas eqt support 93

jetty with php

<Category: Java> 查看评论

http://quercus.caucho.com/

楠哥服务器上不让搞php,山人自有妙计,借助Quercus,纯100%java编写,在java服务器上也可以跑php程序了,哈哈。

最新版是Quercus 4.0.3,下载地址:

4.0.3 .war src源文件 2010-01-11

使用:   最简单直接的方法,就是解压放Quercus压缩包到java应用服务器,如Tomcat的wepapp目录,其他的配置同Tomcat,tomcat配置在此不说了,删除目录里不需要的image目录什么的,然后在里面直接放你的php程序就可以了。 

   推荐jetty,这里下载集成php的jetty(其实啥都没干,就扔了个目录进去了,哈哈),无需等待和配置,解压执行,下载这里http://www.box.net/shared/x0spxxpi4n

截图:

1.启动默认显示Quercus的欢迎界面,提示一切顺利,真是谢谢啊

Capture1

2.搞个自带的探针瞧瞧

探针

官方介绍:

        Quercus is Caucho Technology’s 100% implementation of 5 released under the Open Source GPL license. Quercus comes with many modules and extensions like PDF, PDO, MySQL, and JSON. Quercus allows for tight integration of Java services with scripts, so using with JMS or Grails is a quick and painless endeavor.

With Quercus, PHP applications automatically take advantage of Java application features just as connection pooling and clustered sessions.

Quercus implements PHP 5 and a growing list of PHP extensions including APC, iconv, GD, gettext, JSON, MySQL, Oracle, PDF, and Postgres. Many popular PHP application will run as well as, if not better, than the standard PHP interpreter straight out of the box. The growing list of PHP software certified running on Quercus includes DokuWiki, Drupal, Gallery2, Joomla, Mambo, Mantis, MediaWiki, Phorum, phpBB, phpMyAdmin, PHP-Nuke, WordPress and XOOPS.

Quercus presents a new mixed Java/PHP approach to web applications and services where Java and PHP tightly integrate with each other. PHP applications can choose to use Java libraries and technologies like JMS, EJB, SOA frameworks, Hibernate, and Spring. This revolutionary capability is made possible because 1) PHP code is interpreted/compiled into Java and 2) Quercus and its libraries are written entirely in Java. This architecture allows PHP applications and Java libraries to talk directly with one another at the program level. To facilitate this new Java/PHP architecture, Quercus provides and API and interface to expose Java libraries to PHP.

The Quercus .war file can be run on Java application servers such as Glassfish, i.e. it can be run outside of Resin. This .war file includes the Quercus interpreter and the PHP libraries.

If you are new to Quercus, please check out:

原来java 下部署 php也可以这么容易的,注意mysql等数据库需要通过JNDI来进行连接,毕竟人家还是Java环境,Fuck,下面是详细的README文件内容:

Copyright (c) 1998-2009 Caucho Technology. All Rights Reserved.
This is the README file for Quercus(tm)
=======================================
TABLE OF CONTENTS
  I)    Introduction
  II)   Getting Started
  III)  Using a database with Quercus
  IV)   JDBC Connections
  V)    Quercus Open Source vs. Quercus Professional
  VI)   Quercus on Tomcat
  VII)  Quercus on Glassfish
  VIII) Resources
I) Introduction
—————
Thank you for downloading the Quercus standalone .war package.

Quercus is Caucho Technology’s 100% Java implementation of PHP 5.
II) Getting Started
——————-
First, make sure you are running JDK 5 or greater.

Then follow your server’s instructions for deploying a war file.  After
deploying, browse to the Quercus webapp and the index page will check that
Quercus is correctly deployed.
III) Using a database with Quercus
———————————-
Quercus only needs a JDBC driver in order to use a particular database.
To use the PHP mysql functions, you will need the MySQL JDBC driver.
IV) JDBC Connections
——————–
Quercus is able to use database connections from a DataSource configured
using JNDI.  Application servers typically provide a mechanism for making a
connection pool DataSource available with JNDI.

Quercus database connection methods accept the JNDI name directly:

  $conn = mysql_connect(“java:comp/env/jdbc/myDatabaseName”)

  OR

  $pdo = new PDO(“java:comp/env/jdbc/myDatabaseName”);

If the web.xml contains a configuration for a JDBC database, then Quercus will
ignore the arguments to PHP database functions and will connect directly to
the preconfigured database.

    <init-param>
      <param-name>database</param-name>
      <param-value>jdbc/myDatabaseName</param-value>
    </init-param>

Quercus will use the above database for all calls to the database like the
ones below:

  $conn = mysql_connect(“localhost”, “user”, “pass”);

  OR

  $pdo = new PDO(“mysql:host=localhost”, “user”, “pass”);

Consult the documentation for your application server for instructions on
configuring a database and making it available with a JNDI name.
V) Quercus Open Source vs. Quercus Professional(丫的,居然还留了一手,我靠)
———————————————–
Quercus Professional offers significantly faster performance over
Quercus Open Source because it compiles php scripts to java source code.
To use Quercus Professional, you will need to:

1) Download Quercus Professional standalone.
2) Have a valid license file.
3) Specify the location of your license in your web.xml.

<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE web-app
    PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN”
    “http://java.sun.com/j2ee/dtds/web-app_2_2.dtd“>
<web-app>
  <servlet>
    <servlet-name>Quercus Servlet</servlet-name>
    <servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
    <init-param>
      <param-name>license-directory</param-name>
      <param-value>WEB-INF/licenses</param-value>
    </init-param>
  </servlet>
</web-app>
VI) Quercus on Tomcat
———————
1) Download the latest Quercus standalone war file.

2) Place the war file in your webapps directory for a war deploy, or extract the
   war contents into your webapps/ROOT directory.

3) Start Tomcat.

4) Quercus should now be running.  To check, browse to the Quercus webapp and
   an index page will test to see if Quercus is running.

The following step is only needed if you intend to use a database in
Quercus with Tomcat:

5) Download the appropiate database driver and place it into Tomcat’s
   lib directory.
VII) Quercus on Glassfish
————————
You can use autodeploy or deloy the webapp via the Glassfish web admin:

1) Download the latest Quercus .war file from http://quercus.caucho.com.

2) Log into Glassfish web admin.

3) Click on deploy Web Application (.war).

4) Point Glassfish to the location of the Quercus .war file’. Then click OK.
   Glassfish will automatically deploy Quercus.

5) Quercus should now be running.  To check, browse to the Quercus webapp and
   an index page will show up indicating the status of Quercus.  Or you can
   click on “Launch” from Glassfish admin’s “Web Applications” page and your
   browser will go to the Quercus webapp.

6) PHP files can now be added to the root directory of the expanded web
    application.

The following steps are only needed if you intend to use a database in
Quercus with Glassfish:

7) Download the databse driver and place it into Glassfish’s
   lib directory.

Follow the next steps if you want to configure a JDBC connection.

8) In Glassfish web admin, create a JDBC Connection Pool.  Specify the database
   name, username, and password.

9) In Glassfish web admin, create a JDBC Resource with a JNDI name , for example
   “jdbc/myDatabaseName”.

10) Configure Quercus to use the JDBC database by adding a tag to
    WEB-INF/web.xml:

    <init-param>
      <param-name>database</param-name>
      <param-value>jdbc/myDatabaseName</param-value>
    </init-param>
VIII) Resources
————-
1) http://www.caucho.com
   Go here for documentation, guides, examples, and Quercus downloads.

2) http://bugs.caucho.com
   Report bugs here.

3) http://forum.caucho.com
   Forums for Resin, Hessian, and Quercus.

4) http://maillist.caucho.com
   Mailing lists for Resin, Hessian, and Quercus.

更全的文档 quercus: php in java:http://quercus.caucho.com/quercus-3.1/doc/quercus.xtp

总结,耍耍还行,没前途

本文来自: jetty with php