PHP session_start () conflicts with require_once. how can this problem be solved?

Source: Internet
Author: User
Tags php session bcms
PHP session_start () conflicts with require_once. what should I do? I debugged it on Baidu's BAE platform .. You want to use a BCMS-SDK to get a mail effect .. At present, there is a problem: session_start (); and require_once & nbsp; (& nbsp; "Bcms. linoleic PHP's session_start () conflicts with require_once. what should I do?
I debugged it on Baidu's BAE platform .. You want to use a BCMS-SDK to get a mail effect ..
There is currently a problem:
Session_start (); and require_once ("Bcms. class. php"); two statements, no matter which one is written in front of the statement, can run in the past, and then stuck in the latter.
For example
Echo "01 ";
$ AccessKey = '';
$ SecretKey = '';
$ QueueName = '';
$ Host = 'bcms .api.duapp.com ';
Echo "2 ";
Require_once ("Bcms. class. php ");
Echo "4 ";
Session_start ();
Echo "3 ";
The output is 0124, and the program hangs at session_start,
However
Echo "01 ";
Session_start ();
$ AccessKey = '';
$ SecretKey = '';
$ QueueName = '';
$ Host = 'bcms .api.duapp.com ';
Echo "2 ";
Require_once ("Bcms. class. php ");
Echo "4 ";
Output 012. The program is suspended at require_once.
More importantly, if I write as follows:
Require_once ("Bcms. class. php ");
Session_start ();
Echo "01 ";
The code does not report an error, but when you open the page, the error 500 will be displayed, and the server will directly fail ..
Why? PHP session Baidu? App? Engine require require_once shared:
------ Solution --------------------
Session_start (); no output is available. As for the 500 error you mentioned, you can enable the php error prompt to know what went wrong.
------ Solution --------------------
MorePrevious code violations: there are echo in front of session_start ()... errors will naturally occur.
You can use ob_start (); at the beginning of the program to avoid

For MoreYou must at least debug the code locally.
If there is no local environment, first check whether the file name Bcms. class. php is written correctly, especially in case, and check whether the file exists.
If there is no problem, paste his code

------ Solution --------------------
Equire_once ("Bcms. class. php ");
Session_start ();
Echo "01 ";

No output exists before session_start.

------ Solution --------------------
In
Echo "2 ";
Var_dump (file_exists ('bcms. class. php '));


You have to explain what has been done in Bcms. class. php?

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.