我在Wordpress上收到“无法分配内存”错误,其他任何线程都没有帮助我,所以我决定再次询问我的具体情况。
我使用以下规格运行专用服务器:
在服务器上,我运行一个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上的服务器管理器中看到的样子
另外,这是最近一次批量发布后出现的更多错误,此错误将持续约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' );
}
}
最佳答案
关于php - 无法分配内存错误问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47192534/