`

session_start()关于Cannot send session cache limiter

阅读更多
在windows下编程,当使用session_start()方法的时候,有时会报
session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/inpublisher/php1.php:1)这样的错误,说是已经有输出,用编辑器打,前面明明什么都没有,原来在使用AJAX的 时候,也出现过这种情况,后来,把这个PHP文件放到linux中打开,会发现,在文件的最前面,会出现“锘 ”这样的一个字符(引号内),把它去掉以后,再运行,OK,运行正常。后来在网上搜索一些文件,给的解释是:UTF8文件的BOM(Byte Order Mark)标志,在保存的时候会自动存入!
不管它是干嘛的,现在的目的就是把它去掉,我总结的方法有下面三种:
1、       在Linux下打开,去掉后再保存
2、       用写字板打开,把光标放到最前后回车,然后再敲删除,重新回到第一行,这样最前面的那个字符就会去掉
3、        使用UltraEdit编辑器(很好用的一个编辑器,网上多的是,自己下去),打开高级----配置----Unicode/utf-8 检测,把自动检测UTF-8文件,自动检测没有BOM的Unicode文件等前面的勾全去掉,然后你再打开那个文件,就会发觉“锘 ”这个字符出现了,删除就OK了
分享到:
评论

相关推荐

    php session_start()关于Cannot send session cache limiter - headers already sent错误解决方法

    在windows下编程,当使用session_start()方法的时候,有时会报session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/...

    php session_start()出错原因分析及解决方法

    错误提示: Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent 原因:在session_start()之前如果有输出内容,会出错, 解决办法:在session_start()...

    php session_start()关于Cannot send session cache limiter – headers already sent错误解决方法

    说是已经有输出,用编辑器打,前面明明什么都没有,原来在使用AJAX的 时候,也出现过这种情况,后来,把这个PHP文件放到linux中打开,会发现,在文件的最前面,会出现“锘 ”这样的一个字符(引号内),把它去掉以后...

    解决php中Cannot send session cache limiter 的问题的方法

    今天在使用php 的session 的时候,出现了以前就遇见但是又解决不了的问题,在页面上出现如下提示: Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers...

    PHP session_start()问题解疑(详细介绍)

    Cannot send session cookie – headers already sentWarning: Cannot send session cache limiter – headers already sent分析及解决办法这一类问题,的原因是你在程序中使用PHP session_start()时,之前已经有...

    PHP中header和session_start前不能有输出原因分析

    在http传输文本中,规定必须 header和content顺序必须是:header在前content在后,并且header的格式必须满足... 2、session开启是会隐含的触发是否用header(“Set-Cookie: sid=xxxxxx”),也就是其实还是一个隐式的head

    php session 错误

    错误提示 Warning: Cannot send session cookie – headers already sent Warning: Cannot send session cache limiter – headers already sent 分析及解决办法 这一类问题,的原因是你在程序中使用session_start()...

    PHP会话处理的10个函数

    在PHP开发中,比起Cookie,Session 是存储在服务器端的会话,相对安全,并且不像 ...最好将这个函数置于最先,而且在它之前不能有任何输出,否则会报警,如:Warning: Cannot send session cache limiter – headers a

    PHP session常见问题集锦及解决办法总结

    Cannot send session cookie – headers already sent Warning: Cannot send session cache limiter – headers already sent 分析及解决办法 这一类问题,的原因是你在程序中使用session_start...

    php.ini-development

    user_ini.cache_ttl = 300 ;;;;;;;;;;;;;;;;;;;; ; Language Options ; ;;;;;;;;;;;;;;;;;;;; ; Enable the PHP scripting language engine under Apache. ; http://php.net/engine engine = On ; This directive...

Global site tag (gtag.js) - Google Analytics