The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Character Set UTF-8

Discussion in 'General Discussion' started by adam5532, Aug 5, 2013.

  1. adam5532

    adam5532 Member

    Joined:
    Feb 14, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    After configuring everything in Apache for UTF-8 and being baffled why my pages still showed Windows and ISO character sets, I finally realized that I had to set UTF-8 in PHP also.

    So, I added default_charset = "utf-8" to my /usr/local/lib/php.ini and that fixed it!

    What do I need to do to make sure that this change isn't overwritten when I run EasyApache the next time, and why with all the multitude of setting options available in WHM is the character set not something that can be chosen and set through the UI?

    Thanks,
    Adam
     
  2. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    132
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    You can add default_charset in PHP Configuration Editor in WHM.
     
  3. adam5532

    adam5532 Member

    Joined:
    Feb 14, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    It looks like I already had that set to utf-8. But it was not until I manually added default_charset = "utf-8" to my php.ini file that it actually worked. A search does not find any other entry for utf-8 or charset in the ini file. Any ideas why?
    Thanks, Adam
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can make changes to the /usr/local/lib/php.ini file via:

    "WHM Home » Service Configuration » PHP Configuration Editor"

    Adjusting the "default_charset" value via this option will update the php.ini file accordingly. Remember to restart Apache after making the change to ensure it takes effect. Could you be more specific about what specific value you are expecting to see in the php.ini file that does not exist?

    Thank you.
     
Loading...

Share This Page