I have a PHP file that always listens to a socket, I must have a tab opened in my browser to execute that file, Is there a way to define some PHP files to apache to execute automatically when apache starts?
Asked
Active
Viewed 52 times
1
-
Heard of cron jobs..? http://stackoverflow.com/questions/18737407/how-to-create-cron-job-using-php – 웃웃웃웃웃 Dec 18 '14 at 05:39
-
I want to run just one time when apache starts, it has a while and it doesn't need to run periodical with cron jobs @웃웃웃웃웃 – mohammad falahat Dec 18 '14 at 05:47
1 Answers
1
I would recommend you to check this article: http://webadvent.org/2009/daemonize-your-php-by-sean-coates
It recommends to install supervisord
to make sure that one instance of your php script is running. It's something that you would make frequently when working with async job queues.

Nazareno Lorenzo
- 1,069
- 2
- 14
- 25