|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6652 include() require() add trailing CRLF
Submitted: 2000-09-10 18:11 UTC Modified: 2001-04-10 09:31 UTC
From: kevin at henrikson dot com Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.4 OS: RedHat Linux 6.2
Private report: No CVE-ID: None
 [2000-09-10 18:11 UTC] kevin at henrikson dot com
When using include() or require imbeded in HTML a trailing new line is added. Example:


Will produce:

START<<File contents>>

The file can contain any number of characters.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-16 18:25 UTC]
Cannot reproduce that on my system. Could you publish your
 [2000-09-17 02:14 UTC] kevin at henrikson dot com
Start include.php
End include.php

This is some text

Niether file has a trailing new line.  Remember to do a view source to see this because the browser will not render a new line.  
 [2001-01-12 21:29 UTC]
have you by any chance updated your PHP since 4.0.2? does it still happen?
 [2001-01-13 12:52 UTC] kevin at henrikson dot com
Yes,  We are now running 4.0.4  It has the same result.

 [2001-01-13 13:11 UTC]
hm... unable to reproduce it on RH6.2 with 4.0.4
does it happen only with include() and require()? does the appended newline appear after the include()d / requre()d text at the end of the whole resulting document?
what's the auto_prepend_file directive set to? 
 [2001-01-13 17:31 UTC]
sorry, it should have been 

... after the include()d / requre()d text OR at the end of ...
 [2001-03-08 20:14 UTC]
I can not reproduce this one either. 
Are you sure that the include.php has got
only one line in it which isn't terminated with newline?


 [2001-04-10 09:31 UTC]
No feedback. If this happens with soon to be released PHP 4.0.5 too, reopen this bug report.


 [2002-08-15 23:24 UTC] hoanghp2000 at yahoo dot com
I used IIS 5.0, PHP 4.0.5
When I used include() function with charset=utf-8 
The result page have some character before tag. If you used IE 5.5 SP2 those characters did not view on the screen. If you used older IE you will see the block on the screen.
How do you solve this problem ?
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Aug 24 22:01:26 2019 UTC