我曾经使用 XAMPP 进行本地开发,但现在切换到运行 Ubuntu 的 VMware 虚拟机进行本地开发。除了一件事之外,一切都已设置好并运行该站点的本地版本...... css/style.css.php 中有一个脚本,其中包含以下行,但需要根据它所在的服务器以不同方式编写上。
fopen("css/style.inc.css"); // Works on the live server
fopen("../css/style.inc.css"); // Works on the local server
fopen("/css/style.inc.css"); // DOES NOT work on either server
实时机器和本地机器上的文件结构相同。
可能与该问题相关的是脚本不是直接请求的,而是在请求 /css/style.css 时通过 .htaccess 映射。.htaccess 文件看起来像这样
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ rewrite.php?q=$1 [L,QSA]
</IfModule>
rewrite.php 文件看起来像这样......
if($_GET["q"] == "css/style.css"){
include("css/style.css.php");
}
我如何开始诊断两台服务器上的哪些设置不同,以便我可以将它们设置为相同?