Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to set default charset to ISO-8859-1, so I added the line below into httpd.conf.

AddDefaultCharset ISO-8859-9

and I can see that value when I query it with

root@server [/]# curl -A "Mozilla/4.0" http://localhost -I
HTTP/1.1 200 OK
Date: Mon, 10 Sep 2012 22:28:48 GMT
Server: Apache
Last-Modified: Tue, 21 Aug 2012 21:17:25 GMT
Accept-Ranges: bytes
Content-Length: 111
Content-Type: text/html; charset=ISO-8859-1

However, I can't get the same results for virtual hosts and there is no additional definitions for any other charset.

root@server [/]# file temp.php
temp.php: ISO-8859 text

root@server [/]# cat temp.php    
Cesária Évora

root@server [/]# curl -A "Mozilla/4.0" http://somedomain/temp.php -I
HTTP/1.1 200 OK
Date: Mon, 10 Sep 2012 22:28:31 GMT
Server: Apache
Content-Type: text/html; charset=utf-8

Do you have any idea ? Please let me know if you have a clue.

Thank you.

share|improve this question
up vote 1 down vote accepted

The charset attribute in Content-Type for PHP is handled by php.ini.

Add default_charset = iso-8859-1 to your php.ini or use ini_set( "default_charset", "iso-8859-1" ) in your temp.php.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.