By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,414 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,414 IT Pros & Developers. It's quick & easy.

session_start causes Apache to crash (Win32, PHP 5.1.1)

P: n/a
Hello,

Does anyone have a problem with Apache2 crashing after executing a PHP
script with session_start()? I notice if session_start() is placed
anywhere except at the start of the file, APache will crash. Can anyone
explain to me why? I don't want session_start to be at the start of the
file because I need to override some session methods. So session_start
has to happen after the declaration of custom session methods.

Can anyone please help? Thanks.

Vincent

Dec 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
joe
session_start() must be called before any data is sent to the
browser.....just like header() or setcookie().

Dec 20 '05 #2

P: n/a
joe
if you're using cookie based sessions, session_start() must be called
before any data is sent to the browser....but in testing on a similar
setup (win2003/php 5.0.5/apache 2.0.55) I could not crash apache by
breaking that rule. your apache error logs might provide some help...

Dec 20 '05 #3

P: n/a
On 20 Dec 2005 12:20:59 -0800, "Vincent" <vi*******@gmail.com> wrote:
Does anyone have a problem with Apache2 crashing after executing a PHP
script with session_start()? I notice if session_start() is placed
anywhere except at the start of the file, APache will crash.


Is it Apache or PHP crashing?

What are the symptoms - error messages?

Do you mean a real full-blown crash, such as a segmentation fault and core
dump, or is it just an error?

What platform are you on?

There are instructions on http://bugs.php.net for getting a stack trace, which
you'd need to get to the bottom of a core dump:

http://bugs.php.net/bugs-generating-backtrace.php
http://bugs.php.net/bugs-generating-backtrace-win32.php

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Dec 20 '05 #4

P: n/a
Thanks for the replies.

The thing is Apache error log has nothing that indicates the crash.
It's Apache that crashs (with the standard Window error message that
Apache has terminated). I am on Windows XP.

I want to override my session methods to use my own database for
session handling instead of the default cookie handling. But after
declaration of those methods, and then run session_start, Apache
crashes.

Thanks for the suggestion on getting a stack trace. I will be doing
that shortly.

Vincent

Dec 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.