SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist lance_vincent's Avatar
    Join Date
    Aug 2004
    Location
    philippines
    Posts
    574
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Apache Config, needs some enlightment

    Hi guys, I'm back with more weird character encoding problems. I was ask to help fix our backend system with encoding issues. At the end of the day I was losing luck, so I ask our senior guy to meddle in. In the end he was able to fix the problem on our network server. I updated my version on my local machine, but his fix doesn't work on my local server. In short, what I'm asking you guys is to help me figure out what the heck is going on between the two machines involved.

    My local server (My machine), care of Apache2triad has the following settings:
    Code:
    Apache Version: Apache/2.2.0 (Win32) PHP/5.1.2
    HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    // Under HTTP Headers Information
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Content-Type: text/html; charset=ISO-8859-1
    Our network server (some other pc on the network), care of Xammp has the following settings:
    Code:
    Apache Version: Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i SVN/1.6.3 PHP/5.2.9 
    HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7 
    // Under HTTP Headers Information
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Content-Type: text/html
    Aside from the minor Apache version difference, I think there's a big deal with our difference in "Header Content type". The php page in question displays data in html with the meta UTF-8. The page also saves information from a form without utf8_encode; Everything is in default fashion, but on my end the characters are not displaying properly.

    So in short, before we delve into details, I would like to have your idea on 1. what is going on here and 2. how does charset declared on the page (meta) affect the data sent/retrieve from the server (request/response by the server)? I need to understand this before i can shake the issue out my head, i want to learn! dklynn, im looking at you.
    If you won't dress like the
    Victoria Secret girls,
    don't expect us to act like soap opera guys.

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    l_v,

    I'm not sure you've even described a problem except that your test server isn't outputting the same (or any) thing as the production server. IMHO, the differences between the Apache versions and PHP versions isn't significant and the only real difference is that your test server specifies ISO character output (I've never seen that specified for text/html before so I have to ask WHY you've specified that at all).

    Further, the code used to script your output is missing and that would usually be a key to the problem (although I believe it's the specification of the output above).

    What's going on here? I took my guess above in that the specification for output for text/html is unusual and, because it's lacking on the production server, it's the likely culprit.

    Charset affect? Apparently, it makes Apache (or PHP) throw a fit because you're feeding a different character set to the output stream.

    Of course, I'm only guessing.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Evangelist lance_vincent's Avatar
    Join Date
    Aug 2004
    Location
    philippines
    Posts
    574
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey David, its nice to hear your always there to throw in your two cents. I've figured it out this morning, after reading your reply, I headed back to my phpinfo() and ponder on it a little bit. Its what we expect, it has to do with the Content-Type. The network server only specifies "text/html" meaning its not going to alter the character set, but on my local machine, it converts it to ISO. I approach my senior guy and explained what i figured out, and he thinks it was a useful observation.

    Thanks again! I think I have a good idea whose going to grab the Apache Guru of the year.
    If you won't dress like the
    Victoria Secret girls,
    don't expect us to act like soap opera guys.

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,644
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    lv,

    Good guess, eh? Okay, it was pretty simple but only because I'd never seen that before. I was mildly surprised that it didn't cause a startup error, though.

    Thanks for your feedback.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •