Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP header problems porting from FreeBSD to Win XP

Posted on 2004-04-28
3
Medium Priority
?
222 Views
Last Modified: 2010-04-17
I have a PHP site (newest version) that works fine on FreeBSD.

But when I try to port it to my XP laptop so I can work at home, I get errors trying to use the header() redirect.

For instance, a line like this:

     header("location: xxx.php");

will get me an error that says I've already printed out the headers and I can't do it again. It's just not true.

I assume there's either a problem with files being Unix style in XP. Or maybe there's just an Apache or PHP setting I can change?

TIA,
Rich
0
Comment
Question by:thujone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:alexhogan
ID: 10943299
You need to insure that you are not printing out any header information before sending the redirect.

Put your header("location: xxx.php"); as the first thing before any header information and you should be fine.
0
 
LVL 5

Expert Comment

by:danielsonchris
ID: 10944005
Also, check if you are getting any Notices or Warnings prior to that header(...) call.  That can cause the issue too.  
Regards,
Chris
0
 

Accepted Solution

by:
Dany_mx earned 200 total points
ID: 10944833


First open the php file with wordpad (no notepad) and save all the page, with this you change de LF to CR LF


and in your code you can test the follow

<?
ob_start();
header("location: xxx.php");
ob_end_flush();
.....
.....
?>

whit this you turn on the buffer

try it

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Introduction to Processes

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question