Welcome Guest, Not a member yet? Register   Sign In
Output has already been sent to the browser
#1

[eluser]Unknown[/eluser]
Forgive me for being a Codeigniter newbie,

We have our files working perfectly on our server setup by a development company. We wanted to copy our files/directories & database to a local server to make changes to the site without causing errors on our live site. We installed XAMPP on a Windows XP machine, installed CI & then copied the folders/files/database accordingly.

On the local server, we are getting the error

Output has already been sent to the browser at C:\xampp\htdocs\teamcanteen\system\application\controllers\dailydeal.php:6047. Please make sure the command $xajax->processRequest() is placed before this.

Line 6047 of dailydeal.php is
Code:
ob_flush();

I know I corrected the database login information. Anything else I'm missing that would cause this kind of error?

Thanks!
-Mike
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums.

What is dailydeal.php? Is it a model, library, controller, ...? I'm not sure why there's an ob_flush() in there. It's obviously putting out some data, and it's expected to do so. It would be great if we could see some more code - perhaps the controller method you're calling might help a bit more? And perhaps a bit more code from around line 6047 of dailydeal.php
#3

[eluser]Dam1an[/eluser]
Welcome to CI
I'm more intrigued by which you never had this problem on the live server... Unless you've got some funky forking going on in the code where you execute a differant route on the localhost, I can't see why you wouldn;t have got this before?

Does this happen on every page, or just a select few?
#4

[eluser]Jondolar[/eluser]
Is anything else being displayed by the output? Display the source of the web page and check to see if there is any other warning or text/html. Something is sending header information and text to the browser prior to your call to ob_flush. I've typically seen this when transferring from one system to another when an error message/warning is displayed. Do you have warnings disabled in PHP?
#5

[eluser]Geneous[/eluser]
I was getting the following error
Output has already been sent to the browser at some line. Please make sure the command $xajax->processRequest() is placed before this.

I had downloaded all files for xajax from following side.
http://codeigniter.com/wiki/Xajax_perfect_setup/

I was tring the same example that they asked to do and got that error.

I have done lots of R and D for this.But in my case i was getting this error because of i had given a space after ?> at the end of the line on controller page.After some time i realize my mistake then i had removed it.And it works very well.
#6

[eluser]TheFuzzy0ne[/eluser]
As per the [url="http://ellislab.com/codeigniter/user-guide/general/styleguide.html"]CodeIgniter PHP Style Guide[/url], you are encouraged to omit the closing PHP tag, since it helps avoid these types of problems.




Theme © iAndrew 2016 - Forum software by © MyBB