[wp-hackers] wp_redirect() fails on Linux

Justin Sheckler sheckler at nytimes.com
Wed Aug 23 15:17:42 GMT 2006


You might want to check your .php files and make sure the "line-endings"
are in UNIX format... I know this will cause problems with Perl scripts.

http://en.wikipedia.org/wiki/Line_endings#Common_problems

Dr Deviant wrote:
> I had a similar thing, and it was to do with a carriage return before
> the <?php declaration.
> 
> ------------------------------------------
> 
> <?php
> 
> instead of
> 
> ------------------------------------------
> <?php
> 
> 
> Windows didn't seem to care, but it blew up on Linux.
> 
> Similarly anything after the ?> including whitespace and blank lines
> would also do it.
> 
> Cheers
> Nigel
> 
> ----- Original Message ----- From: "AJ Chen" <canovaj at gmail.com>
> To: <wp-hackers at lists.automattic.com>
> Sent: Wednesday, August 23, 2006 6:43 AM
> Subject: Re: [wp-hackers] wp_redirect() fails on Linux
> 
> 
>> my code works on windows, but not on Linux. it's odd. any idea?
>> -AJ
>>
>> On 8/22/06, Austin Matzko <if.website at gmail.com> wrote:
>>>
>>> On 8/23/06, AJ Chen <canovaj at gmail.com> wrote:
>>> > My web2x plugin uses wp_redirect() to start post editor:
>>> >
>>> wp_redirect("http://web2express.org/openlab/wp-admin/post.php?w2x=prj");
>>> >
>>> > It works in my windows xp development environment, but it fails on
>>> > linux
>>> > server with error message:
>>> > *Warning*: Cannot modify header information - headers already sent by
>>> > (output started at /home/ajchen/public_html/openlab/wp-admin/admin-
>>> > header.php:16) in
>>> */home/ajchen/public_html/openlab/wp-includes/pluggable-
>>> > functions.php* on line *272
>>>
>>> wp_redirect works only in the HTTP header, so if you're no longer in
>>> or before the header when calling wp_redirect, you'll get that kind of
>>> error.
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 



More information about the wp-hackers mailing list