SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Weird Character displaying

    Hello, Take a look at the following page:

    http://testweb.tenonusa.com/warranty/

    If you are looking at it in Firefox all you will see is HTML...in IE 6.0 you will see the actual page, but at the top you will notice a weird character 1f70.

    Anyone know why this character is showing up? I think this character has something to do with content in the MySQL database, but not sure

    The other pages work fine on the site. Here is one for example.

    http://testweb.tenonusa.com/about-us/

    I have no idea why this is happening...any ideas is greatly appreciated.

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your warranty page is for whatever reason sending only a single header: the 200 - OK status (just means the server found the requested page). The page is then being sent via the Chunked Transfer-Encoding, however the required header for such ("Transfer-Encoding: Chunked") is not being sent. Nor is the server sending the necessary Content-Type header ("Content-Type: text/html") for the web browser to know that it should be rendering the page as HTML. IE apparently assumes it's HTML, while Firefox assumes that it's plain text; believe it or not, both are responding to this situation appropriately as per spec:
    Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream".
    Anyway, this appears to be a server configuration error. It's possible that PHP is somehow responsible, but without seeing your code I have no way of knowing how/why nor how to fix it.
    PHP questions? RTFM
    MySQL questions? RTFM

  3. #3
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank kromey for your analysis of the problem. It helped a lot.

  4. #4
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JeffGSR View Post
    Thank kromey for your analysis of the problem. It helped a lot.
    Does that mean you've solved it?
    PHP questions? RTFM
    MySQL questions? RTFM

  5. #5
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem has not been solved yet, but from what you said I am pretty sure it is a server error. This website was just transferred to a new server and suddenly this problem arose. This problem did not occur on the old server. So it looks like I will need to contact the server guy.

  6. #6
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kromey View Post
    Anyway, this appears to be a server configuration error. It's possible that PHP is somehow responsible, but without seeing your code I have no way of knowing how/why nor how to fix it.
    Kromey, I am the 'server guy' referred too above. I have installed, configured, and used many apache instances on many platforms and have never seen this issue before. Now I admit my programming knowledge of PHP is limited so I may have missed something in the configuration but I did install wordpress (another php app) to test it out prior to letting someone else use it.

    I am curious as to what I could look for in the configuration that could be causing the problem.

    Server: Apache 2.2.4 ( all modules built and are available as shared )
    MySQL 5.0.41
    PHP 5.2.3

    I enabled php parsing (obviously). I accepted the defaults for php.ini.

    Any help would be appreciated.

    thanks

    Doug

  7. #7
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Honestly, Doug, I have no idea what to look for. When I say it may be a server issue, I'm really just guessing because I can't think of any possible way PHP could be causing this (and I know more about PHP configuration than I do about server configuration). The fact that this script worked perfectly on another server does imply that it's a server issue. On the other hand, the fact that other scripts are functioning just fine on your server suggests it's a script problem.

    Really, I'd like to see the code of the script in question - it could be something in that script that's causing this. This is a very bizarre issue that I've never seen before, but I'm more than willing to help get you guys figure out the cause and fix it. If you'd rather do this off-forum just PM me.
    PHP questions? RTFM
    MySQL questions? RTFM

  8. #8
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jeff will have to give the yea or nay to showing the code ... that will be his call. I used the Live HTTP headers plugin for Firefox and I see that all that is coming back to the browser is the 200 response code. I find it odd that no other headers are sent for this page but I see headers for all other pages.

    I'll keep on digging but I am really at a loss.

    thanks for your assistance!

    Doug

  9. #9
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    more information

    Here is a little more information. If you take some of the content out of the page the page will display properly. It does not matter what the content is it seems to be associated with how much content you remove.

    Also the funky character that was seen seems to be the length of the html being delievered in hex format. The value is not exact but it is real close.

    I am not seeing truncations but I increased the mssql.textsize up from its default in the PHP.ini file.

    Any ideas based on this latest information?

    thanks

    Doug

  10. #10
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should have mentioned earlier, but the "weird character" is, as you deduced, a length in hexadecimal format; it is not the length of the entire page, but rather that of the following chunk (hence how I know the page is being sent via the Chunked Transfer-Encoding). You'll likely notice at least one more hex length that will account for the chunk to make the total length exact (less of course the hexadecimal sizes themselves). In fact, I just pulled it up and got 2 chunks - the first is 0x2770 (10,096) bytes, and the second 0x461 (1,121) bytes. You'll also notice a 0 at the very end - this literally says "The next chunk is 0 bytes in length" and denotes the end of the file.
    PHP questions? RTFM
    MySQL questions? RTFM

  11. #11
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another piece to the puzzle which is making me believe it is a firewall issue. Jeff put up a simple php page that just called php getinfo and that was also failing. So what I did was to create that page on another machine with the same configuration and it worked like a charm. So instead of coming in via the domain name I went to the box internally with the ip address and all pages work fine. The outside domain and port 80 are mapped through a firewall to the box. Seeing as it works internally and not externally I feel there is something amiss in etherspace.

  12. #12
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, yeah, that pretty much excludes the script and the server I would think. This is still very weird though - I've never seen anything like this.
    PHP questions? RTFM
    MySQL questions? RTFM

  13. #13
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Solved !

    I had the firewall changed from a proxy configuration to a filter and that seemed to have solved it. I have a feeling that there is a patch for the proxy part of the firewall that needs to be installed or it is a bug they are not yet aware of.

    thanks again for your help kromey

    Did not know there were any IT jobs in Alaska !

  14. #14
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, the proxy's probably blocking some of the necessary headers for some reason. Very weird, though.

    Yup, plenty of IT jobs here - anywhere where you have computers, you have IT jobs! Not to mention that for 9 months out of the year it's too cold to do anything but stay inside on your computer!
    PHP questions? RTFM
    MySQL questions? RTFM


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •