1. Download Quercus:
http://quercus.caucho.com/
Version of course the latest best, because in principle, the new version of PHP more support, but in their own testing to find the latest 4.0.25 there is a problem, so swap 4.0.18 version.
Select File Download in war format, unzip with winrar, copy web-inflib jar to warweb-inflib directory under Gae project
2. Configure Quercus:
To configure support for PHP files in Appengine-web.xml:
- < Static-files >
- < Exclude path="/**.php" />
- Static-files >
- < Resource-files >
- < include path="/**.php" />
- Resource-files >
Add a servlet to Web. xml:
- < Span class= "Tag-name" >servlet >
- < servlet-name > Quercus servlet servlet-name >
- < > com.caucho.quercus.servlet.GoogleQuercusServlet span class= "tag" >!-- servlet-class >
- !-- servlet >
To add a map to a PHP file:
- < servlet-mapping >
- < Servlet-name > Quercus Servlet servlet-name >
- < Url-pattern > *.php url-pattern >
- servlet-mapping >
3. Implement URL rewriting (implemented via Urlrewritefilter):
Download Urlrewritefilter, copy the Urlrewritefilter-*.jar to the Warweb-inflib directory of the Project
Add URL filtering to Web. xml
- <filter >
- < Filter-name > Urlrewritefilter filter-name >
- < Filter-class > Org.tuckey.web.filters.urlrewrite.UrlRewriteFilter filter-class >
- Filter >
- < filter-mapping >
- < Filter-name > Urlrewritefilter filter-name >
- < Url-pattern > /* url-pattern >
- < Dispatcher > REQUEST Dispatcher >
- < Dispatcher > FORWARD Dispatcher >
- filter-mapping >
Create a new URL rewrite profile in the Warweb-inf directory of the project: Urlrewrite.xml
- XML version="1.0" encoding="Utf-8" ?>
- "Http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
-
- < Urlrewrite >
- < Rule enabled="true" match-type="regex" >
- < Note > Urlrewrite Note >
- < condition type = " request-filename " operator = "notfile" span class= "attribute" >name = "notfile" span class= "attribute" >next = "and" /
- < condition type="request-filename" operator="Notdir" name = "Notdir" next = "and "/>
- < from > /(.*) From >
- < to Last="true" type="forward"> /index.phpto >
- Rule >
- Urlrewrite >
-
This rule is equivalent to the. htaccess:
Rewritecond%{script_filename}!-f
Rewritecond%{script_filename}!-d
Rewriterule ^ (. *) $ index.php/$1
Note: This rule may cause the GAE local management http://localhost:8888/_ah/admin/to fail, as the time relationship is no longer corrected.
4. Test:
Create a new index.php file in the project's War directory:
- Php
- Echo '<pre>
- ?>
Since I have set index.php to welcome file, I will open it directly http://localhost:8888/
Effect:
498) this.width=498; ' OnMouseWheel = ' javascript:return big (This) ' src= ' http://www.bkjia.com/uploadfile/2013/0904/ 20130904095435444.png "alt=" \ "style=" margin:0px; padding:0px; border:0px; "/>
Some references are attached:
http://blog.caucho.com/2009/04/28/quercus-on-the-google-app-engine/
http://blog.caucho.com/2009/05/31/quercus-on-google-app-engine/
http://tuckey.org/urlrewrite/#documentation
Phper are still hesitating what, hurry up ~
http://www.bkjia.com/PHPjc/445669.html www.bkjia.com true http://www.bkjia.com/PHPjc/445669.html techarticle 1. Download the quercus:http://quercus.caucho.com/version of course the latest best, because in principle, the new version of PHP more support, but in their own testing to find the latest 4.0.25 exist ...