PHP file to be executed in background LINUX

1

I need to put a PHP file on my server that works in the background and not have to start it every time you start a user session and / or wait for it to expire and have to use it again.

The file is a socket developed in PHP so that it can listen to requests every time a controller sends data to the specified port. Therefore, I require the aforementioned.

Any commands that can be used to start the file in the background?

    
asked by jecorrales 15.02.2018 в 23:17
source

1 answer

0

Use cron or crontab to execute scheduled tasks, you can use PHP as a system script, just add the corresponding header #!/usr/bin/php and save it as a .sh :

#!/usr/bin/php
<?php
//Tu script ...
  

Information:

     

Execute an PHP periodically with cron

     

Cron & Crontab, explained

    
answered by 20.02.2018 в 05:10