Cakephp 3.0 identifier quoting

Уведомление администрации о проблемах с хостингом ZZZ.COM.UA (www, ftp, почта, панель управления и т.п.).

Повідомлення адміністрації про проблеми з хостингом ZZZ.COM.UA (www, ftp, пошта, панель управління і т.п.).
Ответить
olvit
Сообщения: 1
Зарегистрирован: Пн мар 21, 2016 3:23 pm
Пол: Не указан
Агент пользователя: Firefox Windows 1920x1080

Cakephp 3.0 identifier quoting

Сообщение olvit »

Добрый день! Решил воспользоваться вашим хостингом.
При попытке входа на http://lenina105.adr.com.ua/users/login
получаю вот такую ошибку: If you are using SQL keywords as table column names, you can enable identifier quoting for your database connection in config/app.php.

Рекомендации cake по настройке app.php выполнил: 'quoteIdentifiers' => true,
на локалке все было ОК.



<?php
return [

'debug' => filter_var(env('DEBUG', true), FILTER_VALIDATE_BOOLEAN),


'App' => [
'namespace' => 'App',
'encoding' => env('APP_ENCODING', 'UTF-8'),
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
'base' => false,
'dir' => 'src',
'webroot' => 'webroot',
'wwwRoot' => WWW_ROOT,
// 'baseUrl' => env('SCRIPT_NAME'),
'fullBaseUrl' => false,
'imageBaseUrl' => 'img/',
'cssBaseUrl' => 'css/',
'jsBaseUrl' => 'js/',
'paths' => [
'plugins' => [ROOT . DS . 'plugins' . DS],
'templates' => [APP . 'Template' . DS],
'locales' => [APP . 'Locale' . DS],
],
],


'Security' => [

],


'Asset' => [
// 'timestamp' => true,
],

/**
* Configure the cache adapters.
*/
'Cache' => [
'default' => [
'className' => 'File',
'path' => CACHE,
'url' => env('CACHE_DEFAULT_URL', null),
],


'_cake_core_' => [
'className' => 'File',
'prefix' => 'myapp_cake_core_',
'path' => CACHE . 'persistent/',
'serialize' => true,
'duration' => '+2 minutes',
'url' => env('CACHE_CAKECORE_URL', null),
],


'_cake_model_' => [
'className' => 'File',
'prefix' => 'myapp_cake_model_',
'path' => CACHE . 'models/',
'serialize' => true,
'duration' => '+2 minutes',
'url' => env('CACHE_CAKEMODEL_URL', null),
],
],



'Error' => [
'errorLevel' => E_ALL & ~E_DEPRECATED,
'exceptionRenderer' => 'Cake\Error\ExceptionRenderer',
'skipLog' => [],
'log' => true,
'trace' => true,
],

'EmailTransport' => [
'default' => [
'className' => 'Mail',
// The following keys are used in SMTP transports
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
'tls' => null,
'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],


'Email' => [
'default' => [
'transport' => 'default',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
],


'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
/**
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//'port' => 'non_standard_port_number',
'username' => '************',
'password' => '*************',
'database' => 'cake335',
'encoding' => 'utf8',
'timezone' => 'UTC',
'flags' => [],
'cacheMetadata' => true,
'log' => false,

/**
* Set identifier quoting to true if you are using reserved words or
* special characters in your table or column names. Enabling this
* setting will result in queries built using the Query Builder having
* identifiers quoted when creating SQL. It should be noted that this
* decreases performance because each query needs to be traversed and
* manipulated before being executed.
*/
'quoteIdentifiers' => true,

//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],

'url' => env('DATABASE_URL', null),
],


],

/**
* Configures logging options
*/
'Log' => [
'debug' => [
'className' => 'Cake\Log\Engine\FileLog',
'path' => LOGS,
'file' => 'debug',
'levels' => ['notice', 'info', 'debug'],
'url' => env('LOG_DEBUG_URL', null),
],
'error' => [
'className' => 'Cake\Log\Engine\FileLog',
'path' => LOGS,
'file' => 'error',
'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'],
'url' => env('LOG_ERROR_URL', null),
],
],


'Session' => [
'defaults' => 'php',
],
];
Аватара пользователя
alexbel
Друг Zzz
Сообщения: 137
Зарегистрирован: Пт мар 11, 2016 5:58 am
Откуда: Беларусь
Пол: Мужчина
Агент пользователя: Firefox Windows 1920x1080
Контактная информация:

Cakephp 3.0 identifier quoting

Сообщение alexbel »

Во время импорта базы данных Вы кодировку меняли базы на хостинге? У вас на сайте я только что посмотрел стоит UTF-8:

Код: Выделить всё

<meta charset="utf-8"/>
Базы данных на хостинге ZZZ по умолчанию создаются в кодировке 1251, отличие кодировки сайта от кодировки в MYSQL приводит к различным ошибкам. Вы в применяли к базе данных MYSQL следующий SQL-запрос?

Код: Выделить всё

ALTER DATABASE НАЗВАНИЕ_ВАШЕЙ_БД DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
После ответа Вами на выше поставленные вопросы, можно двигаться дальше в случае возникновения ошибок. Ну а пока, это первое на что стоит обратить внимание.

Так же что то напрягает параметр в ошибке:

Код: Выделить всё

'base' => false,
Но для начала давайте определимся с кодировкой...
_________________________
Изображение
Ответить

Вернуться в «Поддержка клиентов ZZZ.COM.UA / Підтримка клієнтів ZZZ.COM.UA»