简体   繁体   English

如何停止 MAMP 中的 30 秒超时?

[英]How to stop 30s timeouts in MAMP?

I am running WordPress code (to import 25 posts) that trips a 500 server error (reported via ajax) after 30 seconds, but the process continues on the server in the background.我正在运行 WordPress 代码(导入 25 个帖子),该代码在 30 秒后触发 500 服务器错误(通过 ajax 报告),但该过程在后台的服务器上继续进行。

For the life of me, I cannot find any evidence of a 30-seconds setting...对于我的一生,我找不到任何 30 秒设置的证据......

php7.4.33.ini... php7.4.33.ini...

max_execution_time = 1300
max_input_time = 3000
memory_limit = 512M

apache_error.log is showing pairs of these... apache_error.log 正在显示成对的这些...

[Sat Apr 22 14:41:31.336668 2023] [fastcgi:error] [pid 10888] [client ::1:59639] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php7.4.33.fcgi" aborted: idle timeout (30 sec)
[Sat Apr 22 14:41:31.391265 2023] [fastcgi:error] [pid 10888] [client ::1:59639] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php7.4.33.fcgi"

... though I'm not sure is strictly limited to the 500 events. ...虽然我不确定是否严格限于 500 个事件。

This is in Apache's httpd.conf...这是在 Apache 的 httpd.conf 中...

<IfModule mod_fastcgi.c>
    # URIs that begin with /fcgi-bin/, are found in /var/www/fcgi-bin/
    Alias /fcgi-bin/ "/Applications/MAMP/fcgi-bin/"

    # Anything in here is handled as a "dynamic" server if not defined as "static" or "external"
    <Directory "/Applications/MAMP/fcgi-bin/">
        SetHandler fastcgi-script
        Options +ExecCGI
    </Directory>

    # Anything with one of these extensions is handled as a "dynamic" server if not defined as
    # "static" or "external". Note: "dynamic" servers require ExecCGI to be on in their directory.
    AddHandler fastcgi-script .fcgi .fpl
    
    MAMP_ActionPhpCgi_MAMP
    FastCgiIpcDir /Applications/MAMP/Library/logs/fastcgi
    MAMP_FastCgiServer_MAMP

    <IfModule mod_setenvif.c>
        SetEnvIf Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
</IfModule>

max_execution_time and max_input_time are not in .htaccess max_execution_timemax_input_time不在 .htaccess

I added...我加了...

<IfModule mod_php5.c>
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>

... but it didn't change (though I can't confirm if I have the php5 module). ...但它没有改变(虽然我无法确认我是否有 php5 模块)。

Adding this...添加这个...

<IfModule mod_fcgid.c>
    FcgidIdleTimeout 600
    FcgidProcessLifeTime 600
</IfModule>

... and this... ... 和这个...

<IfModule mod_fcgid.c>
    FcgidIdleTimeout 300
    FcgidProcessLifeTime 3600
    FcgidMaxProcesses 128
    FcgidMaxProcessesPerClass 8
    FcgidMinProcessesPerClass 0
    FcgidConnectTimeout 300
    FcgidIOTimeout 300
</IfModule>

... also didn't change it. ...也没有改变它。

I believe I found answer for your question.我相信我找到了你问题的答案。

Just modify the line to state shown bellow and it should be working for you.只需将行修改为如下所示的 state,它应该适合您。

MAMP_FastCgiServer_MAMP -idle-timeout 3600

It's really weird that MAMP doesn't have setting for this. MAMP 没有为此设置真的很奇怪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM