MAMP LocalHost服务器无法正常工作

时间:2014-06-13 18:32:56

标签: php mamp

LocalHost显示空白页面。我将Apache的端口更改为80,当我按下打开的页面时,它会转到localhost / mamp就好了。当我删除/ mamp时,我得到的只是一个空白页面。我尝试过多种方法,例如关闭mamp,启动它,重新启动我的机器。我检查了我的文件夹设置,没关系。

我通过创建一个新的文件页面index.html来测试它,它打开就好了。

我不知道为什么它没有打开我的index.php文件。这是我的header.php的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'); 
    ?>

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

<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>
相关问题