The error message for a session is very simple. who can explain it (! ) Notice: A session had already been started-ignoring session_start () in D: \ php2 \ wamp \ www \ shop \ top. php on line 2
Call Stack
# Time Memory Function Location
1 0.0010 177552 {main} () .. \ index. php: 0
2 0.0020 183496 include ('d: \ php2 \ wamp \ www \ shop \ top. php ') .. \ index. php: 8
3 0.0020 183528 session_start () .. \ top. php: 2
Who can help explain what this error means? the first line is that the session is enabled repeatedly? what are the following lines? time and memory?
Thank you!
Reply to discussion (solution)
This is because the session_start () function is used multiple times on the page.
There are two solutions:
1) in php. ini file set session. autostart to 0 configure php. ini to set session. autostart = 0
Session. auto_start = 0
2) In your code use this line In the error page, edit your code as follows:
If (! Session_id () session_start ();
Instead
Session_start ();
This is because the session_start () function is used multiple times on the page.
There are two solutions:
1) in php. ini file set session. autostart to 0 configure php. ini to set session. autostart = 0
Session. auto_start = 0
2) In your code use this line In the error page, edit your code as follows:
If (! Session_id () session_start ();
Instead
Session_start ();
What are the meanings of the following lines?
Indicates the location of your call
You 'd better write session_start () in a method to check whether the session is enabled. then you can call the method to set/call the session.
The following lines also indicate that you have repeatedly called session_start ()
A session had already been started-ignoring session_start ()
Session_start () is repeated.
This is an error warning for php5.4. it is unfriendly!
@ Session_start ();
Block it.
The following is the call stack information provided by xdebug.
Time: The start Time of execution, in seconds.
Memory usage in bytes
Function execution Function
Location File: Line
You have repeatedly called session_start ()