LocalHost显示空白页。我将Apache的端口更改为80,当我按下open page时,它会转到localhost/mamp。当我删除/mamp时,我得到的只是一个空白页。我尝试了很多方法,比如关闭mamp,启动它,重新启动我的机器。我检查了我的文件夹设置,没有问题。
我通过创建一个新的文件page index.html来测试它,它打开得很好。我不知道为什么它不打开我的index.php文件。这是header。php的代码块。
<html>
<head>
<title><?php echo $pageTitle; ?></title>
<link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700" type="text/css">
<link rel="shortcut icon" href="favicon.ico">
</head>
这里是index。php
<?php
$pageTitle = "A store of unique t-shirts";
include('inc/header.php');
?>
任何帮助都会很感激。
<head>
和</head>
之间的任何内容都不应该显示在页面上,所以也许可以尝试添加一些将在页面上打印的内容。例如,您可以将header.php
更改为以下内容,以查看是否有任何显示:
<html>
<head>
<title><?php echo $pageTitle; ?></title>
<link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Oswald:400,700" type="text/css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<p>Hello, this is content.</p>
</body>
</html>