Jump to content

I have a header error question (and, yes, I did read the sticky at the top)


ThisisForReal

Recommended Posts

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!

Link to comment
Share on other sites

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.)

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.