mantis pages downloaded as php files sometimes

Get help from other users here.

Moderators: Developer, Contributor

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

mantis pages downloaded as php files sometimes

Post by monotek » Mar 08, 2010 8:06 am

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: 7672
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: mantis pages downloaded as php files sometimes

Post by atrol » Mar 08, 2010 8:15 am

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: Jul 01, 2008 11:20 am

Re: mantis pages downloaded as php files sometimes

Post by monotek » Mar 09, 2010 4:02 am

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: 7672
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: mantis pages downloaded as php files sometimes

Post by atrol » Mar 09, 2010 4:21 am

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: Jul 01, 2008 11:20 am

Re: mantis pages downloaded as php files sometimes

Post by monotek » Mar 10, 2010 4:06 am

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: 7672
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: mantis pages downloaded as php files sometimes

Post by atrol » Mar 10, 2010 6:16 am

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: Jul 01, 2008 11:20 am

Re: mantis pages downloaded as php files sometimes

Post by monotek » Mar 10, 2010 11:23 am

Does not work.

monotek
Posts: 24
Joined: Jul 01, 2008 11:20 am

Re: mantis pages downloaded as php files sometimes

Post by monotek » Mar 17, 2010 8:28 am

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