我最近在我的WordPress网站上发现我有时会遇到500内部服务器错误.我检查了日志,我有很多行,如:[Mon Oct 03 01:25:24.357439 2016] [fcgid:warn] [pid 12840] [client83.27.211.107:36968] mod_fcgid: stderr: PHP F...

我最近在我的WordPress网站上发现我有时会遇到500内部服务器错误.我检查了日志,我有很多行,如:
[Mon Oct 03 01:25:24.357439 2016] [fcgid:warn] [pid 12840] [client
83.27.211.107:36968] mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 77 bytes)
in /var/www/vhosts/mywebsite/public_html/wp-includes/wp-db.php on line
1832
我试图增加内存限制:
define( ‘WP_MAX_MEMORY_LIMIT’ , ‘512M’ );
define( ‘WP_MEMORY_LIMIT’ , ‘512M’ );
甚至更多,但它没有奏效.无论我设置它仍然超过内存限制一些字节.我认为对数据库的一些查询存在问题,但是如何检查哪个?
includes / wp-db.php的内容:
} else {
$num_rows = 0;
if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
while ( $row = mysqli_fetch_object( $this->result ) ) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
} elseif ( is_resource( $this->result ) ) {
// server crashing at line below
while ( $row = mysql_fetch_object( $this->result ) ) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
}
// Log number of rows the query returned
// and return number of rows selected
$this->num_rows = $num_rows;
$return_val = $num_rows;
}
解决方法:
问题是由iThemes Security插件引起的.我关掉它,错误消失了.如果我知道这个插件的哪个部分导致超出内存限制,我会更多地研究这个问题并编辑这个答案.
本文标题为:WordPress致命错误:在1832行的wp-includes / wp-db.php中,允许的内存大小为536870912字节(试图分配77个字节)


基础教程推荐
- 织梦DedeCMS搜索指定多个栏目文档的办法 2022-11-11
- 织梦dedecms如何在dede:sql中使用[field:global.autoindex/] 2022-08-27
- dedecms织梦无需登录注册可下单购买的修改 2022-11-04
- pbootcms二次开发必须要了解的后台目录结构 2023-07-09
- pbootcms网站自动清理runtime缓存方法 2023-07-09
- 织梦dedecms调用当前栏目文章数的方法 2022-11-08
- dedecms根据来访IP区域自动跳转对应页面的方法 2022-07-21
- dedecms织梦cms常用判断语句汇总 2022-06-24
- PbootCMS网站标题描述等标签限制字数的办法 2023-07-08
- dedecms织梦全局变量调用方法总结 2023-07-08