Help - Search - Members - Calendar
Full Version: Session_start() Error Messages When Page Loads
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
kevin_k
Hello All:

Well, I've managed to get all of my problems worked out so far except when my Comic page loads ( comic.vndv.com ) I get the following error at the top of my page:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /www/vndv.com/c/o/m/comic/htdocs/index.php:12) in /www/vndv.com/c/o/m/comic/htdocs/index.php on line 20

At first there was another error about not being able to start the session but it disappered after a page refresh. I think it is still a problem though and if I can recreate it I'll edit this post. Can we not start sessions on our web pages? I can't believe that but right now I'm not so sure...

Help Bread! Thanks in advance.

EDIT: Whew, I fixed it. I had a !DOCTYPE statement as the first line of my HTML. When I removed the !DOCTYPE line and put the session_start() at the top it worked without errors. I develop my code on my local machine with Apache installed as part of a development package called WAMP and I guess sometimes there are differences in the host's Apache version and mine - obvious I guess - this project has been painful at times but I have learned quite a bit. I shouldn't have panicked and posted before I ran some tests but I've been working very hard on this project and at times I get really twitchy. Sorry folks.
Ed
It's possible you had warnings off via your php configuration, it's always good to have warnings on and deal with them accordingly.

In this instance the sessions wouldn't of been started on your WAMP's page.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.