PHP running as a FastCGI application (php-cgi) - how to issue concurrent requests?

前端 未结 3 539
失恋的感觉
失恋的感觉 2020-12-31 16:03

EDIT: Update - scroll down
EDIT 2: Update - problem solved


Some background information:

相关标签:
3条回答
  • 2020-12-31 16:38

    Hi this comes a little late, I've wrote a spawner for php-cgi.exe on windows, not perfect but it might be what you needed. Check it at here.

    0 讨论(0)
  • 2020-12-31 16:40

    Okay, I managed to find the cause of the problem. It wasn't my code at all. It's PHP, it cannot spawn additional php-cgi's under Windows when running as FastCGI mode, under Linux it works perfectly, I simply pointed my server to my linux box IP and it had no problems with concurrent FCGI requests. Sucks, but I guess that's the way it is...

    I did look deeper into the PHP source code after that and found that the section of code which responds to PHP_FCGI_CHILDREN has been encapsulated by #ifndef WIN32 So the developers must be aware of the issue

    0 讨论(0)
  • 2020-12-31 16:51

    re: spawn-php python script...

    Thanks @nosam that really helped.
    For those wanting to get it working quickly you'll need the following (if 64bit system)

    ActivePython-2.7.2.5-win64-x64.msi
    pywin32-217.win-amd64-py2.7.exe

    ActivePython does not have older versions of these on their www so you will need to do a bit of googling around to find a working mirror (there are plenty out there)

    Once you have downloaded the src from bitbucket you may need to edit spawn-php.py (to fix up the tab spacing), as bit-bucket seemed to mess up the tab's in the file preventing it from running.

    All-in-all that saved my day for a busy little windows website using nginx + fast-cgi.

    Thanks mate!

    0 讨论(0)
提交回复
热议问题