Magento:仅增加SOAP调用的max_execution_time?

时间:2015-12-18 10:14:37

标签: php magento soap

在Magento系统中,对于PHP请求,我将全局max_execution_time设置为60秒。但是,对于对SOAP API的某些调用,此限制是不够的。我想要做的是将API请求的执行时间增加到10分钟,而不会影响正常的前端页面。

如何仅为Magento SOAP请求增加max_execution_time?

2 个答案:

答案 0 :(得分:1)

对于Apache

可以在vhost中使用<LocationMatch "/api/">节点进行配置。将最大执行时间放在该节点内(以及任何其他规则,如max memory),它们只会应用于命中/ api /.*

的请求

对于Nginx

在Nginx中,您应该能够完成同样的事情:

location ~ ^/api {
    fastcgi_read_timeout 600;
}

答案 1 :(得分:-2)

index.php中的

在顶部添加此行

if(strpos($_SERVER['REQUEST_URI'],"api/")!== false){ 
    ini_set("max_execution_time",3600) 
};
相关问题