Paylaşılan sunucu sınırları Global php.ini 30 saniye max_execution_time için Cronjob büyük bir dosyayı alamıyor

0 Cevap php

i am tring to set up a cron job which import into my database products and categories, i have already the script doing this job but my host compay has limited cron GLOBAL max_execution_time to 30 seconds, this not apply for USER php.ini where max_execution_time is already set to 4000. (browser request) For this reason when i run the script via browser i successfully can import up to 5000 products without getting any timeout, but if i use cron it stops after 30 seconds and import just 400 products. I tried to put ini_set ('max_execution_time... xxx it doesnt works, the server limitation blocks the script after 30 seconds. I cannot cut the file in many little ones because this file is updated everynight, would be crazy to do this all days. I can run more jobs 30+30+30 but since the script HAS to replace the old products quantity or details with new ones i cannot tell him to dont override the existing products. I am getting crazy about this, it's extremely important that the products are updated every days and we cannot do this manually. Since we wont buy a VPS or DS just to load a 2mb file, what other kind of solution could we try? how we can bypass this limitation? can i schedule the cronimport.php in some other way instead of using cron, or maybe calling it with cron tru another script? really confused :) I am sorry for my poor english.

Teşekkür ederiz!

0 Cevap