【发布时间】:2014-04-06 15:18:53
【问题描述】:
我知道这个问题已经被问了一百万次了,但我似乎找不到对我有帮助的答案。
我刚刚建立了一个新的 php 网站,正如您在标题中看到的那样,它一直在说:
警告:无法修改标头信息 - 标头已由 /customers/e/7 中的(输出开始于 /customers/e/7/8/andersws.dk/httpd.www/template/index.php:2)发送/8/andersws.dk/httpd.www/template/index.php 第 4 行
到目前为止,文件中的所有内容是:
<!DOCTYPE html>
<?
if(file_exists('first.run')){
header('location: index.php');
}
?>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
// put your code here
?>
</body>
</html>
所以我真的看不出我做错了什么。
【问题讨论】:
-
这很可能是因为在您的开头
<?顶部的这一行<!DOCTYPE html>在标题之前算作输出。放在<html>上面——这类问题已经被问过上千次了;是的,成千上万。
标签: php apache redirect warnings