Is it possible to do a non-stopping program in PHP? For example, using 2% of processor and some memory all of the time. If it’s not possible, can you tell me what direction I should be looking for c++ non-stopping program (on UNIX server) and how to pass variables from PHP to c++.
EDIT:
First: I have max execution time which is stopping it (but I need it for other scripts in problem of bugs).
Second: I don’t want to burn server so while true it’s not the best idea (it have to have some max memory and processor usage).
You can use CLI
Create your
phpfile and run it on thecommand line, it won’t stop unless the code endsYou can limit the memory usage:
php -d memory_limit=128M my_script.phpthis is changingphp.inidirectives so you can edit on your own instead of defining it every time