php - 从崩溃计算机上的文件进行站点迁移和数据库恢复尝试
问题描述
我敢肯定,这是一个长镜头,但我通过RebaseData的 PHP API 将Processwire站点备份数据库从 MyISAM 文件转换为 SQL,并且正在尝试访问该站点时收到此响应:
Fatal error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'boo_pw.pages.parent_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /Users/boo/WWW/booa/wire/core/WireDatabasePDO.php line 390) #0 /Users/boo/WWW/booa/wire/core/WireDatabasePDO.php(390): PDOStatement->execute() #1 /Users/boo/WWW/booa/wire/core/PagesLoader.php(600): ProcessWire\WireDatabasePDO->execute(Object(PDOStatement)) #2 /Users/boo/WWW/booa/wire/core/Pages.php(154): ProcessWire\PagesLoader->getById(Array) #3 /Users/boo/WWW/booa/wire/core/ProcessWire.php(335): ProcessWire\Pages->init() #4 /Users/boo/WWW/booa/wire/core/ProcessWire.php(295): ProcessWire\ProcessWire->initVar('pages', Object(ProcessWire\Pages)) #5 /Users/boo/WWW/booa/wire/core/ProcessWire.php(118): ProcessWire\ProcessWire->load(Object(ProcessWire\Config)) #6 /Users/boo/WWW/booa/index.php(52): ProcessWire\ProcessWire->__const in /Users/boo/WWW/booa/index.php on line 64
Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'boo_pw.pages.parent_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (in /Users/boo/WWW/booa/wire/core/WireDatabasePDO.php line 390)
#0 /Users/boo/WWW/booa/wire/core/WireDatabasePDO.php(390): PDOStatement->execute()
#1 /Users/boo/WWW/booa/wire/core/PagesLoader.php(600): ProcessWire\WireDatabasePDO->execute(Object(PDOStatement))
#2 /Users/boo/WWW/booa/wire/core/Pages.php(154): ProcessWire\PagesLoader->getById(Array)
#3 /Users/boo/WWW/booa/wire/core/ProcessWire.php(335): ProcessWire\Pages->init()
#4 /Users/boo/WWW/booa/wire/core/ProcessWire.php(295): ProcessWire\ProcessWire->initVar('pages', Object(ProcessWire\Pages))
#5 /Users/boo/WWW/booa/wire/core/ProcessWire.php(118): ProcessWire\ProcessWire->load(Object(ProcessWire\Config))
#6 /Users/boo/WWW/booa/index.php(52): ProcessWire\ProcessWire->__const
This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged.
谁能告诉我这是什么意思?
现在在 nginx 上,通过 Laravel Valet ......如果相关的话。不确定我使用的以前的 MySQL 版本,但我刚刚在这里安装了它。
我跑了SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
,现在得到:
User Error
Exception: Template 'home' is used by the homepage and thus must manage access (in /Users/boo/WWW/booa/wire/core/Templates.php line 143)
#0 [internal function]: ProcessWire\Templates->___save(Object(ProcessWire\Template))
#1 /Users/boo/WWW/booa/wire/core/Wire.php(347): call_user_func_array(Array, Array)
#2 /Users/boo/WWW/booa/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___save', Array)
#3 /Users/boo/WWW/booa/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Templates), 'save', Array)
#4 /Users/boo/WWW/booa/wire/core/Template.php(753): ProcessWire\Wire->__call('save', Array)
#5 /Users/boo/WWW/booa/wire/core/Template.php(810): ProcessWire\Template->save()
#6 /Users/boo/WWW/booa/wire/core/WireHooks.php(619): ProcessWire\Template->hookFinished(Object(ProcessWire\HookEvent))
#7 /Users/boo/WWW/booa/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessWire), 'finished', Array)
#8 /Users/boo/WWW/booa/wire/core/ProcessWire.php(460): ProcessWire\Wire->__call('finished', Array)
#9 /Users/boo/WWW/booa/wire/core/ProcessWire.php(365): ProcessWire\ProcessWire->__call('finished', Array)
#10 /Users/boo/WWW/booa/wire/modules/Process/ProcessPageView.module(253): ProcessWire\ProcessWire->setStatus(16)
#11 [internal function]: ProcessWire\ProcessPageView->___finished()
#12 /Users/boo/WWW/booa/wire/core/Wire.php(347): call_user_func_array(Array, Array)
#13 /Users/boo/WWW/booa/wire/core/WireHooks.php(548): ProcessWire\Wire->_callMethod('___finished', Array)
#14 /Users/boo/WWW/booa/wire/core/Wire.php(370): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'finished', Array)
#15 /Users/boo/WWW/booa/index.php(56): ProcessWire\Wire->__call('finished', Array)
#16 /Users/boo/.composer/vendor/laravel/valet/server.php(158): require('/Users/boo/WWW/m...')
#17 {main} search►
Source file
File: /Users/boo/WWW/booa/index.php:64
54: $wire->wire('process', $process);
55: echo $process->execute($config->internal);
56: $config->internal ? $process->finished() : extract($wire->wire('all')->getArray());
57:
58: } catch(\Exception $e) {
59: // Formulate error message and send to the error handler
60: if($process) $process->failed($e);
61: $wire ? $wire->trackException($e) : $config->trackException($e);
62: $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")";
63: if($config->debug || ($wire && $wire->user && $wire->user->isSuperuser())) $errorMessage .= "\n\n" . $e->getTraceAsString();
64: trigger_error($errorMessage, E_USER_ERROR);
65: }
66:
67:
Call stack
/Users/boo/WWW/booa/index.php:64 source trigger_error(arguments)
/Users/boo/.composer/vendor/laravel/valet/server.php:158 source require(arguments)
我也尝试使用之前返回的近乎空的 [ProcessWire] 数据库进行迁移的另一个站点
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Error has been logged.
现在正在回归404 Not Found
。
解决方案
ProcessWire 需要删除 MySQL 的 ONLY_FULL_GROUP_BY 设置: https ://github.com/processwire/processwire/blob/649d2569abc10bac43e98ca98db474dd3d6603ca/wire/config.php#L975
但看起来你已经处理好了。
这(https://processwire.com/talk/topic/19585-solved-error-message-acces-home-template/)可能会采用您获得的模板主页异常。
推荐阅读
- javascript - 缺少 src 的图像
- vue.js - 如何在服务端渲染页面中使用一些 Vue 组件
- mysql - 需要将 SQL Query 转换为 Gorm 查询
- android-studio - 如何更改 Android Studio 中 logcat 中显示的模拟器
- reactjs - 当我在子组件中提交表单时,如何更新我定义了 contexAPI 的父类的状态?
- oracle - 插入oracle表时Rowid不按顺序
- javascript - 将具有一些新属性的对象数组添加到另一个具有相同名称的对象数组中
- azure - 基于许可的订阅阻止删除 Azure AD 租户
- c++ - 将 char 值分配给 int
- android - 如何从 Android 应用加入 Zoom 会议