I have an array with SQL instructions 'TRUNCATE and INSERT', that assembly is retrieved from the txt file.
The procedures truncate and insert are made on 6 tables, the problem is that one of the tables will receive 110,000 records.
I did some tests:
Phrase ... Error: MySQL server has gone away
Error number 2006 ...
This ... the 500 error
i think your script is too long to execute. check the php log and change execution_time if you cant optimise your script