mantis pages downloaded as php files sometimes

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
monotek
Posts: 24
Joined: 01 Jul 2008, 16:20

mantis pages downloaded as php files sometimes

Post 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?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: mantis pages downloaded as php files sometimes

Post by atrol »

as a first step I recommend to update your PHP to the latest 5.2
Please use Search before posting and read the Manual
monotek
Posts: 24
Joined: 01 Jul 2008, 16:20

Re: mantis pages downloaded as php files sometimes

Post 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?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: mantis pages downloaded as php files sometimes

Post 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?
Please use Search before posting and read the Manual
monotek
Posts: 24
Joined: 01 Jul 2008, 16:20

Re: mantis pages downloaded as php files sometimes

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: mantis pages downloaded as php files sometimes

Post by atrol »

just a speculation:
Remove the empty line 175 at the end of my_view_page.php
Please use Search before posting and read the Manual
monotek
Posts: 24
Joined: 01 Jul 2008, 16:20

Re: mantis pages downloaded as php files sometimes

Post by monotek »

Does not work.
monotek
Posts: 24
Joined: 01 Jul 2008, 16:20

Re: mantis pages downloaded as php files sometimes

Post 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 )
Post Reply