开发者

PHP Page forced download IN ERROR

This is a strange problem but it happens enough that I wanted to ask.

For some reason, sometimes the browser will force a php page to download to the browser and it always comes up with 0 bytes.

Mind you, I'm not trying to force the download and I'm very familiar with headers and forcing files to download intentionally, what I'm talking about is an issue where the browser can't process the page and thus it spits it out as a forced download.

One Example: I've got phpMyAdmin 2.3.2 running on a PHP4 server and a PHP5 cloud server. On the PHP5 cloud server, if I click "browse" on a table it tries to spit out sql.php as a download and it comes out empty.

I know the details are vague and I don't expect a solution as much as some ideas in where to look or possibly if someone else has experienced the same thing.

BIZARRE UPDATE:

When the URL has the word "Select" in all开发者_如何学Go caps it breaks.

Works: phpmyadmin/sql.php?lang=en-iso-8859-1&server=1&db=371016_map_db&table=Data_Recovery&sql_query=Select

Breaks: phpmyadmin/sql.php?lang=en-iso-8859-1&server=1&db=371016_map_db&table=Data_Recovery&sql_query=SELECT

Noodle that one!


ANSWER:

As it turns out, the words SELECT, UPDATE and INSERT (yes, all caps) are blocked words on The RackSpace cloud. You cannot pass these via a GET request, only POST.

However, if you change them to Select, Update and Insert they work just fine. Seems they are not blocking everything.


I have seen that when I'm trying to access a server to which I don't have a valid network route. For example, I set a tunnel proxy in Firefox, through ssh. Then try to connect to localhost - I get a download of a 0 byte PHP file.

The download is happening because it has an extension of PHP, with no content, and the server is not sending you a MIME type, so the browser doesn't know how to handle it, and reverts to a download.

Sounds like a server misconfiguration.

PS. stop using PHP 4.


In my experience this sometimes comes with a segmentation fault of the webserver, due to php scripts behaving badly (the foo(){foo();} kind of crash)

segmentations faults are logged in the apache error log.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜