500 Internal Error – PHP Timeout When Connecting to External WordPress Database

I’m having an issue with a script I’ve written. I’m doing some basic screen scraping and saving it to a WordPress database. The script functions as it should but when I’m trying to do multiple pages (like around 20 pages), it gives me a 500 error after running a big chunk of the script. On the script page I included this:

set_time_limit(0);
ignore_user_abort(1);

I have also included max_input_time = 0 in the php.ini file in the root of my server which in theory should prevent it from timing out but I am connecting to two other URLs so I’m curious if it may have something to do with one of those connections. Basically, it goes like this:

Script in folder on server -> Queries info from a URL and pulls it back into my server -> Analyzes the data -> Sends it to WordPress database on my server but in a different directory

Is there any way to determine where the timing out is happening? My assumption is that it’s not happening on the script page but with a generic 500 error, I’m not sure how to troubleshoot deeper to identify what’s happening.

Thanks for your help!

Read more here: 500 Internal Error – PHP Timeout When Connecting to External WordPress Database

Leave a Reply

Your email address will not be published. Required fields are marked *