It's complicated.
You need to execute the server.php script and it never needs to exit. If you have access to SSH on your shared server, you can execute it in the same way as in the screenshot and run it as a background task using something like nohup :
$ nohup php server.php nohup: ignoring input and appending output to `nohup.out'
After calling this (using an SSH connection), you can exit and the process will continue. All script fingerprints will be stored in nohup.out , which you can read at any time.
If you do not have access to SSH, and the only way to execute a PHP script through Apache as a result of requesting a page, you can simply go to this page using a browser and never close the browser. But one day there will be some kind of timeout, and the connection between you and Apache closes, effectively stopping the execution of the server.php script.
And in these previous cases, many shared hosts will not allow the script to run indefinitely. You will notice that this line is in server.php :
set_time_limit(0);
This tells PHP that there is no time limit. If the host started PHP in safe mode (which many of them do), then you cannot use set_time_limit , and the time limit is perhaps 30 seconds or even less.
So yes, VPS is probably the best choice. Now I donβt own it myself and I donβt know what the good / bad price is, but I would say HostGator seems fine.
source share