View previous topic :: View next topic |
Author |
Message |
cheater512 Tux's lil' helper
Joined: 03 Nov 2003 Posts: 145 Location: Australia
|
Posted: Mon Jul 03, 2006 1:17 pm Post subject: Apache and PHP returning a blank page on redirect |
|
|
On two fresh servers I get a blank page sometimes when a script uses header("Location: url");
Since I've never gotten this before and its a clean install I thought I should try posting it here.
Versions:
net-www/apache-2.0.58
dev-lang/php-5.1.4 (I also tried php 4 briefly to check)
It occured in two scripts, one of my own creation and Cacti.
I traced the problem in Cacti and I hit the redirect to the installer for when Cacti isnt installed.
Interesting to note that a test script (1 liner) I made worked fine.
I havent touched php.ini yet so I'm using Gentoo's default.
Does anyone have any idea? |
|
Back to top |
|
|
js-x.com Tux's lil' helper
Joined: 04 Jun 2005 Posts: 78 Location: Dallas, TX (USA)
|
Posted: Mon Jul 03, 2006 1:27 pm Post subject: |
|
|
have you checked file permissions? Also the server logs will show (access & error) what you are accessing.
Have you tried two basic scripts:
1) only a redirect command,
2) the redirected to file that says 'hi/test/etc'
Is there some text output before the redirect that is getting printed out?
(A blank line before the <? to start the php)
Header only works if its the first thing before text is send to the client-browser. _________________ Cheers.
--Mike Robb
http://js-x.com/
[Gentoo: AMD-64 3800, 2gigram, Raid-5 S-ATA + 1 IDE, Radeon-X300-SE(128MB PCIe)]
[Gentoo: P4 dual 3ghz, 1.5gigram, S-ATA + 1 IDE, GeForce 6200 (AGP 8x 128MB)]
[Smoothwall: P3, 256Mram, 1 IDE] |
|
Back to top |
|
|
cheater512 Tux's lil' helper
Joined: 03 Nov 2003 Posts: 145 Location: Australia
|
Posted: Mon Jul 03, 2006 1:35 pm Post subject: |
|
|
I did do a 1 line redirect test and it worked fine.
I know that it has to be the 1st thing to be sent but my script has ob_start at the top and Cacti was emerged from portage and it didnt work either.
I packet sniffed it and it returns HTTP/1.1 200 with a Content-Length of 0.
Very strange. |
|
Back to top |
|
|
|