Page 1 of 1

Strange errors happening, hard to diagnose

Posted: Sun Jul 16, 2006 8:38 pm
by bwv2
I'm having some strange errors. The error I'm about to describe does not only happen on one computer; it's on all computers. That rules out the user's computer. Additionally, it's only on ONE page, not all pages. All pages have the same first few lines, but only this one has the error. The first few lines of code on the page are:

Code: Select all

<?
session_start(); 

//header stuff 
include('../design/sheets/calcIncludes/incLogged.php');
$pageTitle=The Site: Business Design Steps - Setup';
$xtra_path='../';
include('../header2.php');
Here's what happens:

--> Go to website, login, get to "welcome" page. Everything is fine.

--> Go to another page, then hit "back" to get back to "welcome.php", then the page format is gone. Writing and buttons still intact, but the top of the screen says:

Code: Select all

Warning: session_start(): open(C:\WINDOWS\Temp\sess_123, O_RDWR) failed: Permission denied (13) in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 1

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php:1) in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 1

Warning: main(design/sheets/calcIncludes/incLogged.php): failed to open stream: No such file or directory in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 3

Warning: main(): Failed opening 'design/sheets/calcIncludes/incLogged.php' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 3

Warning: main(header2.php): failed to open stream: Permission denied in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 6

Warning: main(): Failed opening 'header2.php' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 6
The bottom of the screen says:

Code: Select all

Warning: main(footer2.php): failed to open stream: Permission denied in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 28

Warning: main(): Failed opening 'footer2.php' for inclusion (include_path='.;./includes;./pear') in C:\Inetpub\vhosts\thesite.com\httpdocs\welcome.php on line 28

Warning: Unknown(): open(C:\WINDOWS\Temp\sess_123, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\WINDOWS\Temp) in Unknown on line 0
--> I can hit "refresh" as many times as I want, the issue remains.

--> I have a broken link on the page, and when I click it, I get a "Not Found" page. So I hit "back" to get to the "welcome" page.

--> When I hit "refresh" now, it comes up correctly; no errors.

--> I can "refresh" as many times as I want, it stays good.

--> When I repeat the above steps (new page, then back, then refresh) it happens all over again.

--> If I close all windows and come back later, I get the error on the first try. I then have to do the page change/refresh trick to see it correctly.

Anyone have any ideas? The site is hosted on a dedicated server, Windows Server 2003 Web Edition.

Thanks.

Posted: Sun Jul 16, 2006 9:04 pm
by feyd
the errors are server configuration related. Particularly that the user underwhich your web server runs likely does not have permission to write to the temporary directory to which php is set to use.

Posted: Sun Jul 16, 2006 10:50 pm
by tecktalkcm0391
with everypage [like i say to everyone] do this. you avoid many errors:

Code: Select all

<?php 
ob_start();

// codes


ob_flush();
?>
ob_start(); starts a memory buffer
ob_flush(); cleanly ends the memory buffer (PHP automatically does this but its just better to call it)

Posted: Sun Jul 16, 2006 11:03 pm
by feyd
Output buffering is not a solution to this problem, nor is it a solution for other header based issues.

Posted: Mon Jul 17, 2006 5:14 am
by Chris Corbyn
Yeah using ob_ is a bad workaround for header issues (not this issue!) akin to telling someone to turn error reporting off to "fix" errors. It also uses memory.