DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • May 20, 2013, 12:24:00 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2 3   Go Down
  Print  
Author Topic: Strange redirect() problem  (Read 1050 times)
0 Members and 1 Guest are viewing this topic.
Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« on: August 01, 2012, 01:17:22 PM »

Hello,

Recently I migrated my mod of LoGD off of my own personal server (Debian, running PHP 5.3 without any issues) to a hosting provider, also running Debian.

My site was working amazing on my server. Everything was great, no problems. When I switched to the hosting provider, suddenly redirect() is acting strange. It just displays a blank white page whenever there is a redirect. The URL does not change to the redirected page, but it instead just white-screens when it's called. This is when the server is running under PHP 5.3. If I switch the server to PHP 5.2, it works perfectly fine.

However, I would /prefer/ to use 5.3. As I said, it's working on my own server fine, and I even connected the database of my server to the database of the hosting provider and it was still working fine, so I think it's an issue with the PHP 5.3 on the hosting provider.

It might be something in the php.ini, but I can't figure it out. Anyone know what would cause this behaviour and what to check for/change?

Thanks!
Valor
Logged

Your specimen is being processed...
Nightborn
Captain of the Guard
***
Offline Offline

Posts: 157


View Profile
« Reply #1 on: August 01, 2012, 01:52:08 PM »

Ask them to give you the error log or enable error_handling in your config Wink

Should  tell you why. I can't recall any redirect() problem. It might be due to your site data on the new host or old caches or anything literally.
Logged
Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« Reply #2 on: August 01, 2012, 05:50:32 PM »

I've looked and it doesn't generate an error in the error log. It just fails to redirect.
If I got into the redirect script, and it 'works' if i comment out the exit(); (as in, it redirects properly and doesn't white-screen, but causes a bunch of other adverse effects such as wiping the character display name and automatically killing them, which I don't really understand so this isn't a good fix)

Upon further reading, it appears that FastCGI dislikes the exit() function. I am currently looking for a workaround or fix.

Update 2:
FastCGI is working for 5.2, but failing for 5.3. 5.3 CGI is also failing, but 5.2 CGI works.

I am very confused.
« Last Edit: August 02, 2012, 12:44:39 AM by valor2223 » Logged

Your specimen is being processed...
Nightborn
Captain of the Guard
***
Offline Offline

Posts: 157


View Profile
« Reply #3 on: August 02, 2012, 09:04:09 PM »

PHP is a cgi module?

Poor you - then there might be more/other problems. PHP should always be an apache module, not a cgi extension.
I'd go to another host. Seriously.
Logged
kickme
Global Moderator
Mod God
*****
Offline Offline

Posts: 1588


Yay for elephants!


View Profile WWW
« Reply #4 on: August 02, 2012, 10:00:39 PM »

PHP is a cgi module?

Poor you - then there might be more/other problems. PHP should always be an apache module, not a cgi extension.
I'd go to another host. Seriously.

PHP runs fine as under CGI and FastCGI, as well as with web servers other than Apache.

As for the question at hand, my initial impression is that 5.2 had output buffering enabled, whereas 5.3 does not, and some module being included has whitespace outside of its PHP tags. One way to check this is to remove the @ from the header() line and see if you get an error about being unable to send header information once output has started.
Logged

Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka
Nightborn
Captain of the Guard
***
Offline Offline

Posts: 157


View Profile
« Reply #5 on: August 02, 2012, 10:53:51 PM »

I think differently, because in CGI you have numerous other "security" things built in, which tend to behave strangely.
It runs, sure, but might not have the same behaviour.

Whitespace etc. might be a different issue - turning on error handling is definately a way to determine what's wrong.
Logged
Aeo
Mod God
*****
Offline Offline

Posts: 1077


Doctor.. Who?


View Profile WWW
« Reply #6 on: August 03, 2012, 01:26:45 PM »

I'm having exactly the same problem. o.o Only difference? My PHP is Version 5.2.17..
Logged


Time Lords Online - A Doctor Who RPG! Open Now!
~ My Modules: PM me if you'd like me to code something! Smiley ~
Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« Reply #7 on: August 03, 2012, 03:02:20 PM »

Was it working for you until recently? Did you upgrade or move domains? Which OS are you on?
I'll look into the whitespace thing.  I really just think it's a problem with
exit()

My site's working fine under 5.2 so if worst comes to worst I'll just use that.
I am extremely curious as to what is causing this though.

It's not logging any errors either, which is weird.

Are any errors appearing in your log for you, Aeolus?
Logged

Your specimen is being processed...
Nightborn
Captain of the Guard
***
Offline Offline

Posts: 157


View Profile
« Reply #8 on: August 03, 2012, 03:06:12 PM »

It is not an exit() problem.
This should never(!) be reached.
redirect() is not working properly.
Logged
Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« Reply #9 on: August 03, 2012, 03:07:48 PM »

It is not an exit() problem.
This should never(!) be reached.
redirect() is not working properly.
Oh? I'm new-ish to PHP, I had thought that the exit meant "stop rendering things on the current page that the redirect was called from, but instead start this page"

I shall poke more at the redirect to see where exactly it stops executing under working circumstances.
Logged

Your specimen is being processed...
kickme
Global Moderator
Mod God
*****
Offline Offline

Posts: 1588


Yay for elephants!


View Profile WWW
« Reply #10 on: August 03, 2012, 06:00:55 PM »

It is not an exit() problem.
This should never(!) be reached.
redirect() is not working properly.

Please stop providing incorrect information. A call to header() does not stop script execution. The call to exit() does and is always reached.

I'm having exactly the same problem. o.o Only difference? My PHP is Version 5.2.17..

Can you also remove the @ from the line containing the header() call? The @ suppresses errors, so they won't show in the error log or be displayed (assuming display_errors is set to On).
Logged

Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka
Aeo
Mod God
*****
Offline Offline

Posts: 1077


Doctor.. Who?


View Profile WWW
« Reply #11 on: August 03, 2012, 09:02:38 PM »

Was it working for you until recently? Did you upgrade or move domains? Which OS are you on?

Yes, it has been. No, last time I moved/upgraded was about three months ago. I'm not up to date with computer talk- what's an OS? xD

Are any errors appearing in your log for you, Aeolus?

Nothing related to the current situation, no. I have been, however, getting a lot of:

Quote
[Fri Aug 03 22:38:29 2012] [error] [client 158.255.7.244] File does not exist: /home/aeolus/public_html/403.shtml, referer: http://evolutionathens.net/posting.php?mode=post&f=27

in my error log, of which the date was only yesterday. o.o (And also, I have no file called posting.php.. o.O

Can you also remove the @ from the line containing the header() call? The @ suppresses errors, so they won't show in the error log or be displayed (assuming display_errors is set to On).

Removed it, and still, no errors show up.
Logged


Time Lords Online - A Doctor Who RPG! Open Now!
~ My Modules: PM me if you'd like me to code something! Smiley ~
Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« Reply #12 on: August 03, 2012, 09:05:35 PM »

Was it working for you until recently? Did you upgrade or move domains? Which OS are you on?

Yes, it has been. No, last time I moved/upgraded was about three months ago. I'm not up to date with computer talk- what's an OS? xD

Are any errors appearing in your log for you, Aeolus?

Nothing related to the current situation, no. I have been, however, getting a lot of:

Quote
[Fri Aug 03 22:38:29 2012] [error] [client 158.255.7.244] File does not exist: /home/aeolus/public_html/403.shtml, referer: http://evolutionathens.net/posting.php?mode=post&f=27

in my error log, of which the date was only yesterday. o.o (Ana d also, I have no file called posting.php.. o.O

Can you also remove the @ from the line containing the header() call? The @ suppresses errors, so they won't show in the error log or be displayed (assuming display_errors is set to On).

Removed it, and still, no errors show up.
OS= operating system (of the server running)
If you have command line access to your server (and if it's linux), I suggest running
grep -r "posting.php" *
from the home directory of your install. You can see which file is making a call to that file.
Did you install any modules or make any changes between when it was working and when it wasn't?
Logged

Your specimen is being processed...
Aeo
Mod God
*****
Offline Offline

Posts: 1077


Doctor.. Who?


View Profile WWW
« Reply #13 on: August 03, 2012, 09:18:20 PM »

OS= operating system (of the server running)

Ahhh. Linux.

If you have command line access to your server (and if it's linux), I suggest running
grep -r "posting.php" *
from the home directory of your install. You can see which file is making a call to that file.

I can't seem to find this command line access in my cPanel.. o.o

Did you install any modules or make any changes between when it was working and when it wasn't?

I'm not exactly sure when it stopped working, actually. It's been happening for a while, and I've only kept a changelog of the stuff I've done over the past 2 (or so) weeks.
Logged


Time Lords Online - A Doctor Who RPG! Open Now!
~ My Modules: PM me if you'd like me to code something! Smiley ~
Nightborn
Captain of the Guard
***
Offline Offline

Posts: 157


View Profile
« Reply #14 on: August 04, 2012, 12:11:36 AM »

Please stop providing incorrect information. A call to header() does not stop script execution. The call to exit() does and is always reached.

Sorry, my bad. Just re-read this one.
Logged
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
$100 raised this year
Your help is greatly appreciated!
Who's Online
34 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search