Answer the question
In order to leave comments, you need to log in
PhpDaemon (kakserpom) fastCGI application, how to access it?
The task is to transfer part of the functionality of the web application to the daemon, so that during the processing of user requests it is possible to give the daemon "heavy tasks" for background execution.
I'm trying to deal with phpDaemon'om.
There is a default CGI application. Configured the daemon config as follows -
Pool:Servers\FastCGI {
enable 1;
listen 'tcp://127.0.0.1,unix:///tmp/phpdaemon.fcgi.sock';
port 9000;
privileged;
}
CGI {}
Judging by the logs, the application is rising
[Wed, 2 Jul 2014 14:30:13.347065 +0400] M#26917 \PHPDaemon\Core\Pool:Servers\WebSocket up.
[Wed, 2 Jul 2014 2:30:13.418428 +0400] M#26917 \PHPDaemon\Core\Pool:Servers\FastCGI up.
[Wed, 2 Jul 2014 14:30:13.525354 +0400] M#26917 \PHPDaemon\Core\Pool:\PHPDaemon\Servers\WebSocket\Pool up.
[Wed, 2 Jul 2014 14:30:13.525484 +0400] M#26917 \PHPDaemon\Core\Pool:\PHPDaemon\Servers\FastCGI\Pool up.
[Wed, 2 Jul 2014 2:30:13.612934 +0400] W#26919 \PHPDaemon\Applications\MyWebSocket up.
[Wed, 2 Jul 2014 2:30:13.665546 +0400] W#26919 \PHPDaemon\Applications\CGI up.
[Wed, 2 Jul 2014 14:30:14.743222 +0400] Spawning 1 worker(s)
[Wed, 2 Jul 2014 14:30:15.051203 +0400] W#26925 \PHPDaemon\Applications\MyWebSocket up.
[Wed, 2 Jul 2014 2:30:15.059683 +0400] W#26925 \PHPDaemon\Applications\CGI up.
How can I access a CGI application running in a php daemon from a php script?
Answer the question
In order to leave comments, you need to log in
Randomly came here, and remembered that there was such a question once. Maybe someone will need a solution.
Thanks to all. The point was that background processes are methods of the same web application, and there is a common framework and models.
The solution to the problem - a controller was made that accepted requests only from the local machine. Also, a method was made that accepted parameters and "pulled the curl" (I'm not afraid of these words ;) ) the same controller. Everything.
heavy tasks for background execution should be given to the message queue system - rabbitmq
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question