weiphp移植PHP7.0过程

第一个坑

Call to undefined function Think\simplexml_load_string()

simplexml扩展包的问题,需要安装扩展包

sudo apt-get install php7.0-xml


第二个坑

_STORAGE_WRITE_ERROR_:./Runtime/Cache/Install

路径权限的问题,需要设置跟目录权限可写,这个错误是由于创建Runtime目录没有可写权限造成


第三个坑

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'wp_db.wp_material_news.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

出现这个错误的原因是mysql数据库里面默认将sql_mode增加了 only_full_group_by 的配置,导致无法使用group by来查询,关于sql_mode的相关介绍可以参考如下几个链接:

https://www.cnblogs.com/wangtao_20/archive/2011/02/22/1961795.html

http://blog.csdn.net/ccccalculator/article/details/70432123

http://blog.csdn.net/u014520745/article/details/76056170

使用如下命令在mysql的终端中查询sql_mode:

select @@sql_mode;

修改sql_mode是在配置文件 /etc/mysql/mysql.conf.d/mysqld.cnf 中增加如下内容

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION 

修改后查询结果为:

mysql> select @@sql_mode;
+------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode                                                                                                             |
+------------------------------------------------------------------------------------------------------------------------+
| STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)






你可能感兴趣的:(web)