wordpress-socializr icon indicating copy to clipboard operation
wordpress-socializr copied to clipboard

Cannot activate plugin

Open extrakun opened this issue 9 years ago • 7 comments

Hi, I am trying out this sample plugin, but it cannot be activated. Using WordPress 4.2.4, and MySQL 5.6.25

The error message is:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'utf8mb4'' in C:\Users\extrakun\Dropbox\jobboard\wordpress\wp-content\plugins\wordpress-socializr-master\vendor\illuminate\database\Connectors\MySqlConnector.php:38 Stack trace: #0 C:\Users\extrakun\Dropbox\jobboard\wordpress\wp-content\plugins\wordpress-socializr-master\vendor\illuminate\database\Connectors\MySqlConnector.php(38): PDO->prepare('set names 'utf8...') #1 C:\Users\extrakun\Dropbox\jobboard\wordpress\wp-content\plugins\wordpress-socializr-master\vendor\illuminate\database\Connectors\ConnectionFactory.php(59): Illuminate\Database\Connectors\MySqlConnector->connect(Array) #2 C:\Users\extrakun\Dropbox\jobboard\wordpress\wp-content\plugins\wordpress-socializr-master\vendor\illuminate\database\Connectors\ConnectionFactory.php(48): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array) #3 C:\Users\extrakun\Dropbox\job in C:\Users\extrakun\Dropbox\jobboard\wordpress\wp-content\plugins\wordpress-socializr-master\vendor\illuminate\database\Connectors\MySqlConnector.php on line 38

extrakun avatar Aug 17 '15 13:08 extrakun

as temporary solution you can change your WP constant DB_CHARSET to :

define('DB_CHARSET', 'utf8mb4');

or

define('DB_CHARSET', 'utf8mb4_unicode_ci');

alies-dev avatar Sep 14 '15 09:09 alies-dev

I don't think the temporary define on wordpress will fix it, i had the same error. You have to change HerbertServiceProvider.php that's located on /vendor/getherbert/framework/Herbert/Framework/Providers, there's a line that set the collation, on my version on line 128 you need to change it to utf8mb4_unicdeo_ci or another utf8mb4.

Hope it helps, today i downloaded the framework, hope to learn some stuff. Cheers

fabiangarga avatar Dec 30 '15 04:12 fabiangarga

@fabiangarga this does not work for me .

PrafullaKumarSahu avatar Jan 20 '16 11:01 PrafullaKumarSahu

@lptn your solution too does not work for me .

PrafullaKumarSahu avatar Jan 21 '16 04:01 PrafullaKumarSahu

Any solution for this issue ?

jebog avatar May 09 '16 16:05 jebog

You should set DB_COLLATE in your wp-config to utf8mb4_unicode_ci

jebog avatar May 30 '16 07:05 jebog

Here is the solution:

Edit wp-config.php

And set DB_CHARSET and DB_COLLATION like below

define('DB_CHARSET', 'utf8mb4');

define('DB_COLLATE', 'utf8mb4_unicode_ci');

rameshelamathi avatar Oct 04 '16 13:10 rameshelamathi