I am using the linux command nohup php filename.php &
to create a background php process. The problem here is that, if there are any changes in the files included in filename.php
or even the file itself, I have to kill the current process and start it again. Is there any way to prevent this, so that no restart is required on code update, because I do not want any downtime(because of killing and restarting the process) in my application. If there is no other way around this, then would anyone suggest an alternate approach?
EDIT 1
I am using ZeroMQ for communication between the main process, and this background process. The background process binds to a particular TCP port, say 555. Now, if I try to start a new process, and try to bind it to the same port, it gives an error, as the port is already in use. And thus, I need to kill the process before starting a new one.
EDIT 2
Please check my other question for in-dept explanation of my complete problem with sample code.