| 
	
 | 
 Posted by lawrence k on 06/18/06 17:14 
Jerry Stuckle wrote: 
> lawrence k wrote: 
> > NC wrote: 
> > 
> >>lawrence k wrote: 
> >> 
> >>>How can I find out where my script is outputting to the screen 
> >>>for the first time? 
> >> 
> >>It may not be your script; it could be one of the files you are 
> >>including... 
> >> 
> >> 
> >>>My error logs are full of stuff like this: 
> >> 
> >>... 
> >> 
> >>>but the lines they are pointing to are 
> >>> 
> >>>	session_start(); 
> >>>	session_register(); 
> >> 
> >>You probably have a blank space or an empty line somewhere between the 
> >>beginning of a file and the first "<?"... Find it and delete it. 
> >>Alternatively, use output buffering; start buffering at the beginning 
> >>of the script and dump the buffer after you're done working with 
> >>sessions... 
> 
> 
> Also, turn on all errors and display the errors.  You'll get a message to the 
> effect "Output was started at line xxx in file yyy", which tells you where the 
> code or whitespace caused the headers to be sent. 
 
I'm not sure I know what you mean when you say "turn on all errors". We 
are talking about my error logs - everything is one by default. The 
logs capture everything, including every notice, warning, parse error, 
etc. I don't believe you can even turn that stuff off, in the logs. 
 
But as I said earlier in the thread, PHP is giving me bum messages that 
offer no illumination. My error logs are full this one line, repeated 
over and over again: 
 
 
[18-Jun-2006 07:56:19] PHP Warning:  Cannot modify header information - 
headers already sent in 
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandSetMachineIdOnVisitorsMachine.php 
on line 26 
[18-Jun-2006 07:56:49] PHP Warning:  Cannot modify header information - 
headers already sent in 
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandSetMachineIdOnVisitorsMachine.php 
on line 26 
[18-Jun-2006 12:26:19] PHP Warning:  session_start(): Cannot send 
session cookie - headers already sent in 
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php 
on line 14 
[18-Jun-2006 12:26:19] PHP Warning:  session_start(): Cannot send 
session cache limiter - headers already sent in 
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php 
on line 14 
[18-Jun-2006 12:59:05] PHP Warning:  session_start(): Cannot send 
session cookie - headers already sent in 
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php 
on line 14 
[18-Jun-2006 12:59:05] PHP Warning:  session_start(): Cannot send 
session cache limiter - headers already sent in 
/home/httpd/vhosts/monkeyclaus.org/httpdocs/media/audio/pdsIncludes/CommandStartSession.php 
on line 14 
 
 
But this is line 14 and 15 of CommandStartSession: 
 
		session_start(); 
		session_register(); 
 
 
 
and this is line 26 of CommandSetMachineIdOnVisitorsMachine: 
 
			$success = setcookie("machineId", $machineId, time() + 10000000); 
 
 
Obviously, before these two lines are called, some white space has been 
sent to the browser. But PHP is not telling me where the problem 
starts. 
 
Tha is why I'm wondering if there is some IDE or test system that would 
let me track down where the white space starts.
 
  
Navigation:
[Reply to this message] 
 |