栏目导航
热点推荐
- 开发者必备,超实用的PHP代码片
- 提高PHP编程效率的53种方法
- PHP精华的代码收藏
- PHP.ini配置文件(中文)
- PHP如何防止注入及开发安全
- 提高PHP编程效率的53个要点
- 实际开发中可能用到的PHP的字符
- PHP无限分类的原理
- PHP验证码类代码( 最新修改,完全
- PHP判断端口是否打开的代码
- PHP网站转移实战经验之谈
- phpMyAdmin配置文件说明
阅览排行
在 Windows Azure 网站上运行 CakePHP 应用
www.jz123.cn 2012-08-06 来源: 站长家园 责任编辑(袁袁) 我要投递新闻
在 Windows Azure 上使用 CakePHP 的步骤:
下载 CakePHP 2.2.1
解压下载的压缩包
发布到 Windows Azure 网站
通过 FTP 上传文件到 Windows Azure 或者;
使用 Git 发布 Windows Azure 网站应用
构建应用
我使用的是 CakePHP Blog Tutorial 来测试功能
CakePHP on IIS (aka Windows Azure Web Sites)
需要注意的是 Windows Azure 用的是 IIS 来运行 CakePHP 应用,因此需要一个 web.config 来描述应用,因为 IIS 不支持 .htaccess 文件。
下面是在 CakePHP 网站上的一个 web.config 的示例,用于在 Windows Azure 网站上运行 CakePHP 应用:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="/" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
上一篇:php 操作 MACOS 剪切板 下一篇:在GAE上搭建PHP环境并开启URL重写