skip to Main Content

We’ve switched server for one of my client’s website from a CentOS CPanel to a other CentOS CPanel We encountered some irregularities with accents and single quote.

For some reason, some characters are displaying as it should and some are not :

wrong encoding on different sentences

I’ve tried to change DB_CHARSET to utf8 and I’ve also tried to change table collation without success.
Website was running great on former server. Everything is wrong since we’ve changed it.

One of the users has issues connecting to the site as his user group switch every now and then. I don’t know if it could be related ?

Any help would be very appreciated.

3

Answers


  1. Chosen as BEST ANSWER

    FYI, I've found the issue. It was server related.

    I've checked the list of PHP extensions that were installed on my server and some were missing...

    I don't have the exact list as there was a lot of them missing.

    So, for those who have same issues, check your PHP version and extensions.


  2. Try this to Fix Character Problem in WordPress:

    As you know that latest WordPress defined DB_CHARSET and DB_COLLATE values in wp-config.php. Which is actually the main reason behind this issue. To fix this issue just comment those two lines in wp-config.php file.

    1. Open wp-config.php file and locate below lines

      define(‘DB_CHARSET’, ‘utf8’);

      define(‘DB_COLLATE’, ”);

    2. Comment them out and Save that file. After commenting it should look like

      //define(‘DB_CHARSET’, ‘utf8’);

      //define(‘DB_COLLATE’, ”);

    Now upload the updated ‘wp-config.php’ file to your WebHost (overwriting the old one).

    This character encoding problem can happen after a database upgrade too so it doesn’t hurt to keep this trick in your mind just in case.

    Login or Signup to reply.
  3. You may experience an error when importing a WordPress .sql database from your old hosting to new.

    So, Try again Export a .sql the database file manually via phpMyAdmin on your old host, then import the .sql to your new database. Try bellow steps;

    • Open phpMyAdmin & select your database
    • Click the “Export” tab for the database
    • Click the the “Custom” radio button – In the section titled “Format-specific options:“, change the option for the “Database system or older MySQL server to maximize output compatibility with” from ‘NONE’ to ‘MYSQL40‘.
    • Scroll to the bottom and click “GO”.

    Now you should be able to import your .sql into phpMyAdmin in your control panel.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search