在 Mac OS X for Zend Framework 2 上为 Apache 2 安装和配置 mod_rewrite [英] Install and configure mod_rewrite for Apache 2 on Mac OS X for Zend Framework 2
问题描述
我开始使用 zend 框架 2,他们有一个 先决条件 一个 mod_rewrite for apache 的安装和配置.Apache 2.2.22 预装在 Mac OS X 10.8.2 上.有没有一种简单的方法可以为 apache 安装和配置 mod_rewrite?
I getting started with zend framework 2 and they have a prerequisite of an installation and configuration of mod_rewrite for apache. Apache 2.2.22 came pre-installed on Mac OS X 10.8.2. Is there an easy way to install and configure mod_rewrite for apache?
我遇到的唯一帮助建议重新编译 apache.这是唯一的方法吗?
The only help I have come across suggests to recompile apache. Is this the only way?
推荐答案
要检查 mod_rewrite 和 PHP 是否已启用,请查看 /etc/apache2/httpd.conf 并确保以下几行:
To check that mod_rewrite and PHP are enabled, look at /etc/apache2/httpd.conf and ensure that these lines:
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php5_module libexec/apache2/libphp5.so
未注释.
还要确保在
部分中将 AllowOverride
设置为 All
.
Also ensure that AllowOverride
is set to All
within the <Directory "/Library/WebServer/Documents">
section.
进行这些更改后,使用以下命令重新启动 Apache:sudo apachectl restart
After making these changes, restart Apache with: sudo apachectl restart
如果您随后将项目放在 /Library/WebServer/Documents
文件夹中,那么它应该可以工作.
If you then put your project within the /Library/WebServer/Documents
folder, then it should work.
这篇关于在 Mac OS X for Zend Framework 2 上为 Apache 2 安装和配置 mod_rewrite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!