Emoji works in a site but not in the other site on the same host I am trying to enable emojis following Multi-byte UTF-8 support in Drupal 7.

I have added the following to the settings.php file.

  'charset' =&gt; 'utf8mb4',
  'collation' =&gt; 'utf8mb4_general_ci',


I've converted MySQL tables into utf8mb4 format and set the collate to utf8mb4_general_ci.

On the Drupal 8 site emojis work, while on the Drupal 7 I get the following error.


  4 byte UTF-8 for mysql is activated, but not supported on your system. Please turn this off in settings.php, or ensure that all database-related requirements are met.


What am I missing?

Update

When I try to save a node with an emoji I receive the following error.

StatusText: Service unavailable (with message)
ResponseText: PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string value: &amp;#039;\xF0\x9F\x98\x8A&amp;#039;
First I SUGGEST to take a look at https://www.drupal.org/project/utf8mb4_convert module

try to adding   'charset' =&gt; 'utf8mb4',
  'collation' =&gt; 'utf8mb4_general_ci', configs to your settings.php file.

after adding it should be something like : 

$databases['default']['default'] = array(
  'driver' =&gt; 'mysql',
  'database' =&gt; 'databasename',
  'username' =&gt; 'username',
  'password' =&gt; 'password',
  'host' =&gt; 'localhost',
  'charset' =&gt; 'utf8mb4',
  'collation' =&gt; 'utf8mb4_general_ci',
);


if it does not work for you, probably you need to change MySQL configs. use the following config in your MySQL configuration ( usually my.cnf or my.ini)

# Use UTF8MB4 as the character set
collation-server = utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4'
character-set-server = utf8mb4


another suggestion:

ALTER DATABASE dbname CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;') AS mySQL
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA= "dbname"
AND TABLE_TYPE="BASE TABLE"


FINAL STEP to make the warning go away and get a clean Status Report:

USE YOURDATABASENAME;INSERT INTO variable SET name='drupal_all_databases_are_utf8mb4', value='b:1;';


my.ini or my.cnf
add:

[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true


settings.php

  'charset' =&gt; 'utf8mb4',
  'collation' =&gt; 'utf8mb4_general_ci',