Page 1 of 1

mantis pages downloaded as php files sometimes

Posted: 08 Mar 2010, 13:06
by monotek
I use Mantis 1.2.0.

Sometimes when clicking on my_view_page.php or view_all_bug_page.php the whole page is downloaded as php file with html content.

Sample: my_view_page.php

Code: Select all

<br />
<b>Fatal error</b>:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 524289 bytes) in <b>/var/www/mantis12/file_download.php</b> on line <b>209</b><br />
HTTP/1.1 200 OK
Date: Mon, 08 Mar 2010 12:53:03 GMT
Server: Apache
X-Powered-By: PHP/5.2.4-2ubuntu5.10
Cache-Control: no-store, no-cache, must-revalidate
Last-Modified: Mon, 08 Mar 2010 12:53:03 GMT
Expires: Mon, 08 Mar 2010 12:53:03 GMT
Keep-Alive: timeout=15, max=96
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html;charset=utf-8

b179
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<link rel="stylesheet" type="text/css" href="/mantis12/css/default.css" /> 

.....
My PHP Memory Limit is set to 128 MB.

How can i prevent this error?

Re: mantis pages downloaded as php files sometimes

Posted: 08 Mar 2010, 13:15
by atrol
as a first step I recommend to update your PHP to the latest 5.2

Re: mantis pages downloaded as php files sometimes

Posted: 09 Mar 2010, 09:02
by monotek
OK. This would mean i have to compile PHP by myself :-/

I think ill stay at 1.1.x, which works without such problems.

Should i create a bugreport about the problem?

Re: mantis pages downloaded as php files sometimes

Posted: 09 Mar 2010, 09:21
by atrol
Do you have the official 1.2.0 version installed or 1.2.0 RC2?
I am asking because of this http://www.mantisbt.org/bugs/view.php?id=11362
Is this your problem?

Re: mantis pages downloaded as php files sometimes

Posted: 10 Mar 2010, 09:06
by monotek
I use Mantis 1.2.0 Final and Firefox 3.6.

I will try it with IE8 too...

Edit: It seems IE8 is not affected.

Re: mantis pages downloaded as php files sometimes

Posted: 10 Mar 2010, 11:16
by atrol
just a speculation:
Remove the empty line 175 at the end of my_view_page.php

Re: mantis pages downloaded as php files sometimes

Posted: 10 Mar 2010, 16:23
by monotek
Does not work.

Re: mantis pages downloaded as php files sometimes

Posted: 17 Mar 2010, 13:28
by monotek
The solution of bug http://www.mantisbt.org/bugs/view.php?id=11362 seems to fix my problem too.

SOLUTION from previous version:

file_download.php (line 159)

change:

file_send_chunk( $t_local_disk_file )

to:

readfile ( $t_local_disk_file )