Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5847155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:40:43+00:00 2026-05-22T12:40:43+00:00

I am configuring my Apache/2.2.17 server with PHP 5.3.5. My goal is to create

  • 0

I am configuring my Apache/2.2.17 server with PHP 5.3.5. My goal is to create a clean configuration which defaults to the content-type UTF-8.

php.ini:

default_charset = "UTF-8"
default_mimetype = "application/xhtml+xml"

I receive:

Content-Type: application/xhtml+xml

but require:

Content-Type: application/xhtml+xml; charset=UTF-8

All Apache’s configuration (AddDefaultCharset UTF-8) solutions seem not to work, and I have restarted Apache after I edited my php.ini configuration.

PHP documentation:

default_charset string
PHP always outputs a character encoding by default in the Content-type: header. To disable sending of the charset, simply set it to be empty.

I’ve changed the default_mimetype field to text/html and suddenly, it seems to work: Content-Type:text/html; charset=UTF-8.
Settings the default_mimetype back to application/xhtml+xml will not send the charset=UTF-8. This is without any Apache configuration.

Is PHP broken, or have I missed something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:40:43+00:00Added an answer on May 22, 2026 at 12:40 pm

    I have enabled the iconv module and added to php.ini:

    output_handler = ob_iconv_handler
    

    This handler adds the correct character-encoding for output to the Content-Type, instead of the default_charset.

    However, you should set default_mimetype, or else it puts Content-Type:;charset=character-encoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are a few questions about configuring Apache for local development, such as this
I'm running Apache on Windows XP via Xampplite, and could use help configuring my
've registered xdebug in php.ini (as per http://xdebug.org/docs/install ) but it's not showing up
What handles the disabling of the extension? Is it APACHE or the PHP install?
NetBeans is recommending to use MAMP for Apache + MySQL + PHP on the
I am using the comet long-polling technique with apache, php, jquery. I've got a
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
When configuring the bash on OSX via ~/.profile it seems to completely ignore it
How do I Configuring DoxyGen to document ActionScript files? I've included the *.as and
XAMPP makes configuring a local LAMP stack for windows a breeze. So it's quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.