Opened 7 years ago
Closed 6 years ago
#1483926 closed Feature Patches (fixed)
PHP Warning: Cannot modify header information appearing in httpd-error.log
| Reported by: | fak3r@… | Owned by: | thomasb |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1-rc2 |
| Component: | PHP backend | Version: | git-master |
| Severity: | normal | Keywords: | php headers warning modify |
| Cc: |
Description
Using today's trunk (r288) I recieve these errors when navigating folders or reading emails in Roundcube.
[Sat Jun 17 12:37:22 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 12:37:22 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 12:37:28 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 12:37:28 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:22 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:22 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:27 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:27 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:34 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:34 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:45 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:45 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:52 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:05:52 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:06:00 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:06:00 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:06:29 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:06:29 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 [Sat Jun 17 15:06:39 2006] [error] [client 192.168.1.11] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0 ...
As you can see from the times it happens pretty consistantly. I'm running PHP 5.x, Apache 2.0.58.x on FreeBSD 6.1. Need more info just email me, thanks.
Change History (13)
comment:1 Changed 7 years ago by maildaemon
- Severity changed from normal to critical
comment:2 Changed 7 years ago by zyzzyvas
I am seeing this too. I think it has to do with blank spaces being inserted before PHP header() statements...I bet one (or more) of the PHP files has a stray space at the end or something.
Should be an easy fix.
comment:3 Changed 7 years ago by mnmr
I have fixed this locally by removing the TRUE parameter from program/steps/getunread.inc (line 31).
Seems it was not space related after all ;-)
comment:4 Changed 7 years ago by thomasb
Cannot reproduce, headers should only be sent once.
Can you post your PHP version/configuration?
comment:5 Changed 7 years ago by squishy
I can verify that the solution by mnmr solved it for me also.
Change program/steps/getunread.inc from
31 rcube_remote_response($commands, TRUE);
to
31 //rcube_remote_response($commands, TRUE); 32 rcube_remote_response($commands);
Thanks
comment:6 Changed 6 years ago by kajtzu@…
- Version changed from 0.1-beta to svn-trunk
this is needed for svn-trunk, too. file is now program/steps/mail/getunread.inc
comment:7 Changed 6 years ago by zyzzyvas
My setup is Apache 2.2.4, PHP 5.2.0 (with Zend Optimizer 3.2.2 and Suhosin Patch 0.9.6.1), MySQL 5.0.33 on FreeBSD 6.2-RELEASE.
Changing line 31 in program/steps/mail/getunread.inc reduces the frequency of the errors, but I still get some. Evidently I'm not the only one still seeing them (see #1484220).
comment:8 Changed 6 years ago by thomasb
- Milestone set to 0.1-rc2
- Owner set to thomasb
- Severity changed from critical to normal
- Status changed from new to assigned
Seems to be a rcube_remote_response() issue, but only on PHP 5. Client-server communication is subect to be changed in devel-addressbook branch. Will test this later on.
Ticket #1484220 marked as duplicate of this bug.
comment:9 Changed 6 years ago by moc
I've resolved this problem deleting the line 1980 in /program/lib/imap.inc.
Test it and then close the ticket if it works.
comment:10 Changed 6 years ago by r@…
After deleting line 1980 in /program/lib/imap.inc two days ago, I haven't seen any more "Cannot modify header" error messages. Previously I would see dozens of these per day.
comment:11 Changed 6 years ago by r@…
- Type changed from Bugs to Patches
In two weeks of "production" usage with 60 users, I have not seen one instance of "Cannot modify header information" in the error log since removing "flush();" from imap.inc. Moc's patch is as follows:
*** program/lib/imap.inc Sat Dec 30 07:03:15 2006
--- program/lib/imap.inc.new Thu Apr 12 10:43:11 2007
***************
*** 1977,1983 ****
if (fputs($fp, $request)){
$line=iil_ReadLine($fp, 100);
$sent = fwrite($fp, $message."\r\n");
- flush();
do{
$line=iil_ReadLine($fp, 1000);
}while($line[0]!="A");
--- 1977,1982 ----
comment:12 Changed 6 years ago by r@…
I should mention that the specific error message that removing flush(); fixed is:
PHP Warning: Cannot modify header information - headers already sent in /usr/local/apache2/htdocs/program/include/rcube_shared.inc on line 143
I never saw the originally reported error message:
PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0
comment:13 Changed 6 years ago by thomasb
- Resolution set to fixed
- Status changed from assigned to closed
Should be fixed by removing UTF-8 BOM from localization files in r644/svn

This one still happens in beta 2.
The effect here seems to be that any multipart message
cannot be displayed (i.e. all!).
Cheers.
Paul