无法分配内存错误问题

时间:2017-11-09 01:40:48

标签: php wordpress memory error-handling dedicated-server

我收到的是#34;无法分配内存" Wordpress上的错误,没有其他线程帮助我,所以我决定再次询问我的具体情况。

我使用以下规格运行专用服务器:

Godaddy Dedicated Server

在服务器上,我运行一个Wordpress成人网站,允许用户流式传输服务器上托管的视频。 -----> NSFW My Website

出于某种原因,我不断收到以下错误:

(12)Cannot allocate memory: couldn't create child process: /usr/sbin/suphp

我只是在发布"发布"多个(10-100)视频一次到网站。

以下是我的php.ini

中的代码
upload_max_filesize = 3000M
post_max_size = 2000M
memory_limit = 5000M
file_uploads = On
max_execution_time = 300

当我没有点击"发布"

时,这就是GoDaddy服务器管理器的样子

enter image description here

此外,在最近的大规模发布之后还有更多的错误,这将持续大约2-3分钟才能完全停止

[Wed Nov 08 17:57:16.840005 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:16.839550 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:16.836552 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:16.836021 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:16.832745 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:16.832256 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:02.669004 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for
[Wed Nov 08 17:57:02.668845 2017] [:error] (12)Cannot allocate memory: [client] couldn't create child process: /usr/sbin/suphp for

我没有使用CloudLinux并且未启用RLimitMEM

这是我的/wp-includes/default-constants.php

// Define memory limits.
    if ( ! defined( 'WP_MEMORY_LIMIT' ) ) {
        if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
            define( 'WP_MEMORY_LIMIT', $current_limit );
        } elseif ( is_multisite() ) {
            define( 'WP_MEMORY_LIMIT', '512M' );
        } else {
            define( 'WP_MEMORY_LIMIT', '512M' );
        }
    }

    if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) {
        if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) {
            define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
        } elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 512M */ ) {
            define( 'WP_MAX_MEMORY_LIMIT', $current_limit );
        } else {
            define( 'WP_MAX_MEMORY_LIMIT', '512M' );
        }
    }

1 个答案:

答案 0 :(得分:-1)

  • 通过增加apache配置文件中的php.ini内存限制来解决此问题
  • 确保/usr/local/lib/php.ini中的memory_limit值设置为更高的值
  • 提高/wp-includes/default-constants.php中定义的wordpress内存限制