【问题标题】:MAMP Apache Server - One Subdirectory Works, Another Doesn'tMAMP Apache 服务器 - 一个子目录有效,另一个无效
【发布时间】:2019-05-20 08:10:10
【问题描述】:

我正在通过 MAMP 运行 Apache 服务器。

我在 htdocs 中有两个目录:TWS 和 SHR

SHR 和 TWS 是两个完全独立的 wordpress 安装,每个都有自己的 .htaccess 文件(以前可以使用)。

.htaccess 文件是相同的,除了 TWS 被 SHR 替换

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /TWS/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /TWS/index.php [L]
</IfModule>

我的问题是 localhost:81/TWS 可以访问,而 localhost:81/SHR 返回 500 错误。

apache/httpd.conf 包含一个 htdocs 目录

<Directory "F:\MAMP\htdocs">
  Options All
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

并且 DirectoryIndex 设置为使用 index.html 或 index.php。 TWS 和 SHR 在其根级别都有一个 index.php 文件。

我已经检查了我能找到的所有与 apache、php、mamp 甚至 mysql 相关的日志。没有任何日志表明有错误。

我还能尝试什么?

【问题讨论】:

    标签: apache configuration mamp httpd.conf htdocs


    【解决方案1】:

    事实证明,我正在编辑的一个 PHP 文件中只有一个简单的语法错误。 该错误记录在 wordpress 日志本身而不是 MAMP php 日志中。

    即MAMP/htdocs/SHR/wp-content/debug.log

    一旦我解决了 php 语法错误,一切都恢复正常了。

    【讨论】:

      猜你喜欢
      • 2020-02-29
      • 2012-01-25
      • 2020-07-28
      • 2017-02-11
      • 1970-01-01
      • 2021-05-12
      • 2017-04-30
      • 2019-11-22
      • 2019-08-28
      相关资源
      最近更新 更多