Session_start (); error

Source: Internet
Author: User
Session_start (); error message: test. php file content & lt ;? Phpinclude ('site _ test. php ');? & Gt; site_test.php file content & lt ;? Phpsession_start (); header ('cont session_start (); error
Test. php file content
Include ('site _ test. php ');
?>

Site_test.php file content
Session_start ();
Header ('content-Type: text/html; charset = utf-8 ');
?>

When test. php is opened, the following error is reported, which is hard to understand after a long time. why?


Warning: session_start () [function. session-start]: Cannot send session cache limiter-headers already sent (output started at/home/cybertry/public_html/logs) in/home/cybertry/public_html/idearforyou.com/site_test.php on line 2

Warning: Cannot modify header information-headers already sent by (output started at/home/cybertry/public_html/logs) in/home/cybertry/public_html/idearforyou.com/site_test.php on line 3
------ Solution --------------------
Session_start (); no output in front
------ Solution --------------------
What is site_test.php encoding? if it is UTF-8 encoding, check that there is no bom header.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.