因为请求头部少了“Sec-Fetch-User: ?1”就不行了,可能和微信的安全机制有关
继续阅读作者归档:杨龙
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
把server_names_hash_bucket_size改大点即可,可以改成64或128试下,放在http {}里
| Syntax: | server_names_hash_bucket_size size; |
|---|---|
| Default: | server_names_hash_bucket_size 32|64|128; |
| Context: | http |
Sets the bucket size for the server names hash tables. The default value depends on the size of the processor’s cache line. The details of setting up hash tables are provided in a separate document.
error: Found option without preceding group in config file: /etc/mysql/conf.
可能是少了[mysqld]?可以试下
[mysqld]
innodb_file_per_table
innodb_file_format = Barracuda
Warning: World-writable config file ‘/etc/mysql/conf.d/my.cnf’ is ignored
权限太开放 改下就好了
chmod 644 /etc/mysql/conf.d/my.cnf
chown mysql:mysql /etc/mysql/conf.d/my.cnf
正则匹配所有字符(含换行符)
[\s\S]*
# 说明:空白字符+非空白字符等于全部字符
cc: fatal error: Killed signal terminated program cc1
compilation terminated.
由于内存不足make报错,开启虚拟内存即可
cc: fatal error: Killed signal terminated program cc1 compilation terminated.
请跳转至:
Entity: line 39: parser error : Entity ‘nbsp’ not defined
在 XML 中,只有 5 个预定义的实体引用,$nbsp; 应该替换为空格~
$content = Entities::replaceAllEntities($content);
在 XML 中,有 5 个预定义的实体引用:
| < | < | 小于 |
| > | > | 大于 |
| & | & | 和号 |
| ' | ‘ | 单引号 |
| " | “ | 引号 |
注释:在 XML 中,只有字符 “<” 和 “&” 确实是非法的。大于号是合法的,但是用实体引用来代替它是一个好习惯。
DOMDocumentFragment::appendXML(): Entity: line 45: parser error : PCDATA invalid Char value 8
删除多余的控制字符即可~
$val = preg_replace('/[[:cntrl:]]/mu', '', $val);
Maximum function nesting level of ‘256’ reached, aborting!
ini_set('xdebug.max_nesting_level', 1024);
加大这个限制试试~
innodb_large_prefix
查看表结构,发现token这个字段类型是varchar(4000),默认情况下innodb下创建的索引最大长度是767字节,大概原因我们就知道了,由于字段长度过长,导致创建索引的长度有限,这样实际索引的区分度就非常低了,每次查询都要扫描很多的行,加上这个查询是一个高频的查询,导致了系统运行缓慢。
问题解决
这个问题有几种解决方式:
第一种:
修改数据库参数innodb_large_prefix设置为on,这样可以将创建索引的长度扩大到3072,这样可以提高索引数据的区分度,每次查询时扫描的行数就会降低。当天晚上修改了此参数后,查看执行计划rows扫描的行数就降至到了95,并且第二天也无此SQL的慢查询,慢查询日志文件也从前一天的60个文件较少到了1个
第二种:
通过增加缓存的方式,将token放到缓存中,减少对数据库的访问次数
原文地址