I have a simple learning website for myself that parses source code from other websites. The problem is that sometimes there is an error while reading the source through file_get_contents(). That is fine but somehow the php script starts over after this error occurs. So the more errors occur the more concurrent "threads" are created and executed.
The php script is here: http://pastebin.com/vKZe6cCC
The leaderboeard_parser include: http://pastebin.com/WMd5aWGB
This is the expected output:
30.10.2014 12:55:17 Uploading test statistics ...
30.10.2014 12:55:17: - hardcore season uploaded. Errors: 1
30.10.2014 12:55:17: - hardcore non-season uploaded. Errors: 1
30.10.2014 12:55:17: - softcore season uploaded. Errors: 2
30.10.2014 12:55:17: - softcore non-season uploaded. Errors: 0
Uploading of US statistics done.
This is the usual unexpected output:
30.10.2014 12:55:17 Uploading test statistics ...
30.10.2014 12:55:17: - hardcore season uploaded. Errors: 1
30.10.2014 12:55:48 Uploading test statistics ...
30.10.2014 12:55:17: - hardcore non-season uploaded. Errors: 1
30.10.2014 12:55:48: - hardcore season uploaded. Errors: 0
30.10.2014 12:55:17: - softcore season uploaded. Errors: 2
30.10.2014 12:56:18 Uploading test statistics ...
30.10.2014 12:55:48: - hardcore non-season uploaded. Errors: 1
30.10.2014 12:55:17: - softcore non-season uploaded. Errors: 0
Uploading of test statistics done.
30.10.2014 12:55:48: - softcore season uploaded. Errors: 1
30.10.2014 12:56:18: - hardcore season uploaded. Errors: 2
30.10.2014 12:56:48 Uploading test statistics ...
30.10.2014 12:55:48: - softcore non-season uploaded. Errors: 0
Uploading of test statistics done.
30.10.2014 12:56:18: - hardcore non-season uploaded. Errors: 0
30.10.2014 12:56:48: - hardcore season uploaded. Errors: 0
30.10.2014 12:56:18: - softcore season uploaded. Errors: 0
30.10.2014 12:56:48: - hardcore non-season uploaded. Errors: 0
30.10.2014 12:56:18: - softcore non-season uploaded. Errors: 0
Uploading of test statistics done.
30.10.2014 12:57:19 Uploading test statistics ...
30.10.2014 12:56:48: - softcore season uploaded. Errors: 0
30.10.2014 12:57:19: - hardcore season uploaded. Errors: 0
30.10.2014 12:56:48: - softcore non-season uploaded. Errors: 1
Uploading of test statistics done.
30.10.2014 12:57:19: - hardcore non-season uploaded. Errors: 0
30.10.2014 12:57:50 Uploading test statistics ...
30.10.2014 12:57:19: - softcore season uploaded. Errors: 0
30.10.2014 12:57:50: - hardcore season uploaded. Errors: 1
30.10.2014 12:57:19: - softcore non-season uploaded. Errors: 1
Uploading of test statistics done.
30.10.2014 12:57:50: - hardcore non-season uploaded. Errors: 0
30.10.2014 12:57:50: - softcore season uploaded. Errors: 1
30.10.2014 12:57:50: - softcore non-season uploaded. Errors: 0
Uploading of test statistics done.
Another output (the script ran for 39 minutes, just how ?): pastebin.com/AnNJMvfL
As you can see it seems like multiple instances of the script run concurrently and I have no idea why this occurs. Also this runs on free hosting server.
Also found on a forum that ftp clients can sometimes overwrite files incorrectly so i created new files (source, log) but without change.
If anyone could help me or at least suggest something that could be wrong it would be awesome.
Thank you again.
edit: I have tried it on a different server and it works how it is supposed to work. What could it be then? What sort of setting could cause this repeating?