500 server errors after processing a few records

I have a PHP application doing adds/updates from a list using the XML/RPC API; it works for a few entries but then crashes with a 500 error. It is usually less than 50 records when the problem starts, and there are only 3 API calls for each item (search by field, add or update, optin) so it can’t be reaching the throttling limit. But just to be sure, I added a 5-second pause between items to allow the limit to reset…it didn’t help.

All suggestions are greatly appreciated. Thanks.

@Tzvi_Anolick,

I’ve seen this happen and in every case I’ve seen it in it had nothing to do with the calls out that were being made but rather, it was the server limiting the calls in. In other words, using PHP, when I would use $_POST, the service that parses the post would return 500. So when I change the code to read the input stream and leave the server service for parsing the post out of it, it seems to fix it. So instead of using $_POST I replaced that with something like:

$postData=file_get_contents(‘PHP://input’);

and then use parse_str($postData) to parse it to an array. When doing this, the problem has gone away (at least in my case)

Thanks I’ll give that a try.