【问题标题】:Zend .htaccess configuration not working in UbuntuZend .htaccess 配置在 Ubuntu 中不起作用
【发布时间】:2011-04-27 10:27:30
【问题描述】:

您好,我正在运行 Ubuntu 10.04 LTS - Lucid Lynx 我通过

创建了一个项目

zf 创建项目测试

此命令会自动生成一个不起作用的 .htaccess 文件 我通过编辑配置了我的网络服务器(Apache2) /etc/apache2/sites-available/默认文件 设置

<Directory /var/www/>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride All
 Order allow,deny
 allow from all
</Directory>

我收到以下错误

Internal Server Error
/**************************************************************************************/
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at localhost Port 80
/****************************************************************************************/

请帮帮我

【问题讨论】:

  • 请关注您的 /var/log/apache2/error.log,以便我们查看原因。
  • 嗨我的/var/log/apache2/error.log如下
  • [2010 年 10 月 19 日星期二 18:24:57] [alert] [client 127.0.0.1] /var/www/testing/public/.htaccess: 无效的命令“RewriteEngine”,可能拼写错误或定义由未包含在服务器配置中的模块

标签: zend-framework apache2 ubuntu-10.04


【解决方案1】:

你还没有加载 mod_rewrite,所以 Apache 不知道 RewriteEngine 这一行是什么意思。

在 ubuntu 上,您可能可以这样做(作为超级用户):

a2enmod rewrite
apache2ctl restart

否则你将不得不编辑 apache 配置并添加这样一行来加载模块

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

您系统上的路径可能不同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-14
    • 2015-07-01
    • 2023-04-10
    相关资源
    最近更新 更多