php - Magento curl error 503 after ~60 seconds
I have developed a custom module for magento 1.9 that generates an XML feed with products to be used in an ERP. I am using curl to run it with cron ( curl http://url/action ), but after about 60 seconds, I get a 503 error from magento. I have increased max_execution_time to 300 (verified using phpinfo() ) but it seems to make no difference.
Can anyone help me troubleshoot this? I am using a VPS server with Plesk.
Note: There are around 2000 products right now, so processing does need more than 60 seconds.
Answer
Solution:
Setting a global value of 300 for
max_execution_time
is a bit dangerous as this would allow normal (non-cURL) requests to execute for that amount time. (if it did end up working.) The reason that it may not be working is ifmax_execution_time
is explicitly defined within your Magento installation root's.htaccess
file.Ideally, you would include
ini_set('max_execution_time', 300);
at the top of your Magneto module's controller so it will only run there for 5 minutes.