Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache and PHP returning a blank page on redirect
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cheater512
Tux's lil' helper
Tux's lil' helper


Joined: 03 Nov 2003
Posts: 145
Location: Australia

PostPosted: Mon Jul 03, 2006 1:17 pm    Post subject: Apache and PHP returning a blank page on redirect Reply with quote

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
View user's profile Send private message
js-x.com
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2005
Posts: 78
Location: Dallas, TX (USA)

PostPosted: Mon Jul 03, 2006 1:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
cheater512
Tux's lil' helper
Tux's lil' helper


Joined: 03 Nov 2003
Posts: 145
Location: Australia

PostPosted: Mon Jul 03, 2006 1:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum