PHP version 5.6

I have a PHP program (running in CodeIgniter 'CI_VERSION', '2.1.3') looping through 100 items to process.

Apache (via Codeigniter) will give me 500 Error and no indication anywhere in the logs what actually happened.

Only mySQL /var/log/mysql/error.log has this single line:

[Note] Aborted connection 899 to db: 'dbname' user: 'username' host: 'localhost' (Got an error reading communication packets)

Last lines of /var/lib/mysql/ns1.log - it contains no errors anywhere

2019-07-26T02:08:10.254327Z   581 Connect   username@localhost on dbname using Socket
2019-07-26T02:08:10.254499Z   581 Init DB   dbname
2019-07-26T02:08:10.254607Z   581 Query SET NAMES utf8
2019-07-26T02:08:10.255229Z   581 Query SHOW TABLES FROM `dbname`
2019-07-26T02:08:10.257569Z   581 Query SELECT `value`
FROM (`multiscraper_settings`)
WHERE `key` =  'ts'
2019-07-26T02:08:10.257962Z   581 Query SELECT `value`
FROM (`multiscraper_settings`)
WHERE `key` =  'au'
2019-07-26T02:08:10.258304Z   581 Query SELECT `value`
FROM (`multiscraper_settings`)
WHERE `key` =  'au'
2019-07-26T02:08:10.261331Z   581 Quit  

I am sure that there are no SQL query errors, because if there were, I have enabled all logging and I would see it in the logs (as I have seen such when they happenned).

When I run the program in batches of 25 items, all 100 items complete successfully with no 500 Errors. I am suspecting some variable is hitting a ceiling here. It is not Maximum PHP script run time, because I changed that to unlimited.

What do you think is causing this?


After working on this for a couple of days now, I decided to change the PHP version from 5.6 to 7.2 and it seems to be able to go through all 100 items without any problems.

In actuality I do not know the reason why this happens but it may simply be a bug in PHP 5.6 that was fixed in 7.2.

UPDATE: Yes it seems to be robust now!

UPDATE 2: After some dozen tests, I notice that it still happens but not as often. e.g. just now it failed after 71 iterations. It is more robust for sure because it used to happen in under 35 iterations before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.