PHP mysql 连接错误

来源:百度知道 编辑:UC知道 时间:2024/05/17 22:11:55
A PHP Error was encountered
Severity: Warning

Message: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at H:\PHP\xampp\htdocs\application\config\config.php:1)

Filename: config/settings.php

Line Number: 36

A PHP Error was encountered
Severity: Warning

Message: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\PHP\xampp\htdocs\application\config\config.php:1)

Filename: config/settings.php

Line Number: 36
A PHP Error was encountered
Severity: Warning

Message: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at H:\PHP\xampp\htdocs\application\config\config.php:1)

Filename: controllers/register.php

session_start() 必须放在程序第一行 <?php后

session_start()前不能有任何输出,空格也不行,所以你好好检查下看前面有没有空格或其他输出

注意一下文件的编码。UTF-8 编码的话。文件头会有一个标记的。那个标记在编辑器里不可见。但它会被做为输出存在。
查看方法。用记事本打开PHP文件。然后文件另存为。。下面选项就有编码格式。

config.php文件最顶上一行有空格 或者包含文件中有空格