Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Again, there really is nothing out on the interwebs on this one.

My LiteSpeed, PHP 5.3, Zend Guard host is having trouble displaying my home page.

The homepage has a little php that require()s another php with only:

session_start();

if (!isset($_SESSION['LAST_ACTIVITY'])) {
    $_SESSION['LAST_ACTIVITY'] = time();
    exit();
} else if (time() - $_SESSION['LAST_ACTIVITY'] > 60) {
    session_unset();
    session_destroy();
    session_regenerate_id(true);
    $_SESSION['LAST_ACTIVITY'] = time();
    exit();
}
$_SESSION['LAST_ACTIVITY'] = time();

in it. The rest is good ole fashioned HTML with a few srcs to js and css and a !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" tag.

It will send a page, but it takes ~250ms instead of the more normal ~75ms when the actual page loads.

Examining page source reveals an empty page.

Weird.max.

Many thanks in advance!

Update

Used unencoded PHP. Commented out the session-related PHP. It worked perfectly. Session variable restrictions? Is LAST_ACTIVITY reserved?

More Session Stuff

I edited my session checker to echo certain conditions to the document. It seemed to work well for the most part, but every now and then, it would echo that the session had expired even after setting it only a few seconds before. The PHP checks to see if the session var is set, if not set and echo that it's not set; if the session var is too old, if so dump session, set the session var, and echo; if neither, update the session var and echo.

share|improve this question
    
What is backing your sessions? If you are using a file-based session store and access to it is slow, you might be refreshing faster than your IO can manage. Just a thought. –  rorycl Nov 7 '12 at 22:25
    
Thank-you for that tip! Turns out my code works differently on production site than local wamp. –  Gracchus Nov 8 '12 at 1:00
add comment

1 Answer

up vote 0 down vote accepted

Turns out this wasn't a server issue. To Overflow!

Didn't know that PHP exit() will prevent anything that follows including html not to be processed.

However, in my defense, this worked on my wamp.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.