Search code examples
phpmagentosoapmagento-soap-api

Magento: Increase max_execution_time for SOAP calls only?


In a Magento system, I have a global max_execution_time set to 60 seconds for PHP requests. However, this limit is not enough for some calls to the SOAP API. What I would like to do is increase the execution time to say 10 minutes for API requests, without affecting the normal frontend pages.

How can I increase max_execution_time for Magento SOAP requests only?


Solution

  • For Apache

    This can be configured in your vhost with a <LocationMatch "/api/"> node. Place max execution time inside that node (along with any other rules such as max memory) and they will only be applied to requests that hit /api/.*

    For Nginx

    In Nginx, you should be able to accomplish the same thing with:

    location ~ ^/api {
        fastcgi_read_timeout 600;
    }