ThisisForReal Posted February 21, 2012 Share Posted February 21, 2012 I have a web site with a user login requirement that has worked splendidly for months. I also have a development version of my site on my laptop, localhost. At the moment, I have identical code on both the development and production sites. I'm getting some header error in production, but not on development. Is it guaranteed that my page is generating some white space, or is it possible that there may be another issue at hand (I'm fairly non-technical, so I'm grasping here - my web host upgraded to a different PHP version that is creating whitespace in production while development on my laptop is a different version of php, my web host has done something else that is causing this, fill in the blank with your own conspiracy theory)? Any reading material out there (besides the php.net manual) that explores what may be going on? Thanks in advance - this community has been wonderfully helpful for me over the last year! Quote Link to comment https://forums.phpfreaks.com/topic/257431-i-have-a-header-error-question-and-yes-i-did-read-the-sticky-at-the-top/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 21, 2012 Share Posted February 21, 2012 Most likely output_buffering is turned on, on your development system, which would allow your code to 'work' on the development system and on a server that also have the same setting turned on. If so, you should turn is off ASAP so that the code you develop will work regardless of server settings. Posting the error message, since is shows where the output is occurring at, would help pin down exactly what is causing the problem (it can also be due to the BOM (byte order mark) characters that could be present in your online files, but not in your development files.) Quote Link to comment https://forums.phpfreaks.com/topic/257431-i-have-a-header-error-question-and-yes-i-did-read-the-sticky-at-the-top/#findComment-1319419 Share on other sites More sharing options...
ThisisForReal Posted February 21, 2012 Author Share Posted February 21, 2012 Excellent - I found the output buffering option on my WampServer and turned that off. Now I'm getting similar behavior in both production and development. Thank you for that tip. With regard to the error, I'm not getting any warning/failure text from php. (Caveat: I haven't yet adhered to the header() sticky at the top of this forum about logic placement) I'm just seeing my gif background, the header, and then an empty div box that holds the usual content. I'm guessing that's still a standard header error issue. I am still perplexed why my site worked great for months on end and all of a sudden it is giving me fits now. It would never be a browser issue, right - the problem rests on the server side? Thanks again for such awesome community feedback. For us self-taught folks, it's wonderful. Quote Link to comment https://forums.phpfreaks.com/topic/257431-i-have-a-header-error-question-and-yes-i-did-read-the-sticky-at-the-top/#findComment-1319425 Share on other sites More sharing options...
PFMaBiSmAd Posted February 21, 2012 Share Posted February 21, 2012 The output_buffering setting in the master php.ini likely got turned off, either due to a reinstall (and someone forgot to set the settings as they previously were) or a php version upgrade (and someone forgot to set the settings as they previously were) or a syntax error was introduced in the master php.ini, which causes any settings after the point of the error to take on their default values (output_buffering is off by default when not specifically set to any value.) Quote Link to comment https://forums.phpfreaks.com/topic/257431-i-have-a-header-error-question-and-yes-i-did-read-the-sticky-at-the-top/#findComment-1319430 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.