【发布时间】:2021-03-28 00:10:27
【问题描述】:
我的网站使用 PHP 包含将各种内容作为 .html 文件引入,并将它们转储到我的主页中。它工作完美——直到我的主机“升级”了我的包,现在它完全停止工作了。当他们修改后,他们移动了所有内容,现在保存所有内容的文件夹已更改。这可能是路径问题,但我已经更新了 .htaccess 并且它仍然无法正常工作。我在我的索引文件中尝试了一些技巧,但仍然不起作用。噩梦!
谁能帮忙?
谢谢!
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="_CustomCSS/CustomCSS.css" rel="stylesheet" type="text/css">
<?php include_path = ".:/home/MyUserName/public_html/" ?>
<?php define("HTTP_ROOT1", "http://www.tunedinevents.co.uk"); ?>
<link href="<?=HTTP_ROOT1?>/__Testing/Include_PHP/_CustomCSS/Include_Red_CSS.css" rel="stylesheet" type="text/css">
<link href="<?=HTTP_ROOT1?>/__Testing/Include_PHP/_CustomCSS/Include_Green_CSS.css" rel="stylesheet" type="text/css">
<link href="<?=HTTP_ROOT1?>/__Testing/Include_PHP/_CustomCSS/Include_Blue_CSS.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php include_path = ".:/home/MyUserName/public_html/" ?>
<div class="<?php include $_SERVER['DOCUMENT_ROOT'].'/__Testing/Include_PHP/_CustomCSS/Include_Red_CSS.html'; ?>"></div>
<div class="<?php include $_SERVER['DOCUMENT_ROOT'].'/__Testing/Include_PHP/_CustomCSS/Include_Green_CSS.html'; ?>"></div>
<div class="<?php include $_SERVER['DOCUMENT_ROOT'].'/__Testing/Include_PHP/_CustomCSS/Include_Blue_CSS.html'; ?>"></div>
<div class="Class_Box_1" id="ID_Text_Red">If PHP works properly, this text will be Red</div>
<div class="Class_Box_2" id="ID_Text_Green">If PHP works properly, this text will be Green</div>
<div class="Class_Box_3" id="ID_Text_Blue">If PHP works properly, this text will be Blue</div>
</body>
</html>
【问题讨论】:
-
您能提供您当前的 .htaccess 吗?
-
#AddType application/x-httpd-php .htm .html DirectoryIndex index.html index.htm index.shtml index.php index.cgi index.wml indexHomepage.html php_value include_path ".:/home /MyUserName/public_html/"
-
哦,现场测试页面在这里:tunedinevents.co.uk/__Testing/Include_PHP
-
当我测试该页面并查看控制台时,我收到此错误:%3C:1 加载资源失败:服务器响应状态为 404(未找到)Hmmmmmmmm.....我以为404少了什么???这根本没有意义
-
include_path在我看来很可疑。你确定前面的.:应该在那里吗?