Getting 502 when performing a loop
-
Hi,
I built a web application that takes all the products in the site (Woocommerce-based), converts them to PDF files, and put the files in a directory under wp-content/uploads.
I did it with foreach that loops though all the products, the loop is executed by pressing a button.
The problem is that it’s a complicated action (conver html to pdf, and download the file) and I have like 100 products. So when I triggers the loop, after waiting of like 30 seconds, I get “502
The page request was canceled because it took too long to complete”.
(24 products, does download in that time).
I know it’s more like programmatic php question rather than a WordPress one, but still, does anybody know a way to cancel php from “aborting” after x time?Thanks in advance
- The topic ‘Getting 502 when performing a loop’ is closed to new replies.