Cheap Web Space, Domain Name:
Web Space With E-Mail, PHP/MySQL.

How can I change the PHP default character set without editing php.ini?

Question: 

Searching …

 

Unfortunately nothing found on "".

Premium support for Bitpalace web hosting customers only!

 from the Dominican Republic: +49 30 32 70 18 92, Fax (in Germany) +49 30 32 70 18 91

service@bitpalast.net 

Skype: bitpalast

One moment please … your browser is loading the page.

 

 

Symptom

Your PHP pages display mutated vowels and special characters wrong.

 

Cause

Your PHP scripts are missing explicit commands that define the character set used for script outputs. Therefore the default setting is used (normally UTF-8). Your output however needs a different setting, e.g. ISO-8859-1.

 

Solution

The default character set can be defined in the php.ini file. In shared hosting web space accounts you cannot access php.ini. As an alternative you can configure your .htaccess file. You can either use the one that is already present in your web space's root directory or you can simply create a new one.

Add these two lines to your .htaccess file:

AddDefaultCharset [name of character set]
php_value default_charset [name of character set]

Instead of "[name of character set]" enter the desired character set that shall be used for PHP output by default, e.g. ISO-8859-1:

AddDefaultCharset ISO-8859-1
php_value default_charset ISO-8859-1

 

Overview of frequently asked questions 

 

 

 


 

  from the Dominican Republic: +49 30 32 70 18 92 •  GmbH, Sensburger Allee 27, D-14055 Berlin (Germany)
Your purchase is tax-free, because you order from a non-EU country. © 2024  GmbH. All rights reserved. and the logo are registered trademarks of GmbH. For photo credits see imprint.

Imprint Privacy policy Sitemap