我在看一个Wordpress WooCommerce CSV导出插件。 它工作正常,除了如果我要求它输出超过2000个logging,似乎是超时,我得到一个500(不是503,虽然响应身体看起来像它是为503s)大约31秒后。
我的PHP安装在apache上运行。 从我的apache conf有些东西:
Timeout 300 <VirtualHost *:80> ServerName example.com ... CustomLog /var/log/httpd/example.com-access.log ErrorLog /var/log/httpd/example.com-error.log LogLevel debug </VirtualHost>
并从我的php.ini中select行:
max_execution_time = 300 error_reporting = E_ALL display_errors = On log_errors = On log_errors_max_len = 4096 ignore_repeated_errors = Off error_log = /var/log/httpd/php_errors.log
而我的.htaccess的最后一行:
php_value max_execution_time 300 # just in case
[Thu May 07 15:33:24 2015] [debug] mod_headers.c(743):headers:ap_headers_output_filter()
我不知道为什么它会出现超时(从什么时候开始判断),为什么如果超时是500,而不是503,为什么在错误日志中没有任何内容是真正运行的一个500。
我做错什么了吗? 我能做些什么来诊断呢?
尝试使用php_ini中的memory_limit ,它可能没有空间来存储导出,然后卡住,最终超时。
我的Centos 7服务器(php 5.4)的条目如下所示:
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 1024M
Drupal设置为1024M。