How to enable PHP utf8_decode

Asked

Viewed 169 times

0

Hey, fellas, good morning. I created a virtual machine in Ocean with Linux Ubuntu and PHP 5.6, but when uploading the php system files, the server did not identify / interpreted the command line:

echo utf8_encode($msg)

Is there any configuration I should do in the php configuration files to enable this function or install something on the server ?

Thank you very much!

1 answer

1


Install the module php5.6-xml and restart the Apache:

sudo apt-get install php5.6-xml 
sudo service apache2 restart

If the problem persists, try enabling the module xml2enc:

sudo a2enmod xml2enc
  • Thank you for your support. That solved this problem. But now, I have another question: I have a Hosting on Hostgator and this created on Digital Ocean. On the hostgator, the data returned from the Mysql query without PHP is returning correctly, but on the Ocean Server, the data does not return in UTF8... Would have some configuration to be made ?

  • I recommend asking another question, explaining the details of this new problem, how you built the database, even the character encoding format of your text editor can influence that, it’s very broad, try asking a new question trying to be more specific ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.