1

We have recently installed WT-NMP and are currently running Php-Cgi with php 5.4.24.

We are running fairly simple php scripts and when testing everything is running fine.

Over the weekend we wanted to keep the server running test it over a longer period of time. The server and scripts ran fine all day on Friday, but sometime late on Saturday, the php-cgi stopped running.

There are no errors in the error log (C:\WT-NMP\log). In the configuration (php.ini) I have the following options set: error_reporting = E_ALL display_errors = On display_startup_errors = On log_errors = On html_errors = On error_log = "c:/wt-nmp/log/php_error.log"

We also have the standard nginx.conf error logs: access_log "c:/wt-nmp/log/nginx_access.log"; error_log "c:/wt-nmp/log/nginx_error.log" warn;

So, since the log directory is empty, I am assuming that the running php scripts and general nginx operations are not causing the php-cgi to stop.

So my questions are: What else could cause the php-cgi to stop running? Are there any other options for logging that we could turn on that could help us track this down? Are there other log locations that we should be looking at?

Thanks!

3 Answers3

1

The following setting works fine for Windows 2012 R2 Server !!!

enter image description here

Control Panel-> System->Advanced System Settings->Advanced->Environment Variables->System Variables-> New -> Variable Name: PHP_FCGI_MAX_REQUESTS & Variable Value: 0

squillman
  • 37,618
  • 10
  • 90
  • 145
ActiveA
  • 11
  • 2
  • How exactly does this address the problem as stated in the Question? – Chris S Jun 19 '14 at 20:00
  • Maybe you could add some details as to how this addresses the OP's issue. – squillman Jun 19 '14 at 20:01
  • I used to have the same problem <> but after applying the above setting and restarting WT-NMP the problem is solved for me!!! I'm using Azure Small VM (1 core) Windows 2012 R2 Server... – ActiveA Jun 19 '14 at 20:30
  • It is related to the question here: https://stackoverflow.com/a/13020563/217823 and the answer seems to be the same. It's strange that this setting is not well known and "advertised" by PHP community because it is really crucial to save hours of fruitless debugging and head scratching. – JustAMartin Dec 11 '17 at 11:09
0

As the developer of WT-NMP, I can tell you that WT-NMP is a windows development stack, and should not be used in production servers..

Php-cgi may stop for many reasons (OS, memory, networking), not related to your PHP code. On Linux production servers, there is a process manager (php-fpm) that monitors/restarts/logs such crashed processes. WT-NMP server manager dose not do that (yet).

There are no configuration directives that could help you investigate this issue. Any investigation should start at the OS level.

As a workaround, in conf/php.ini, you should increase memory_limit, disable all unnecessary/unstable php extensions, especially xcache, xdebug and opcache

Update: The latest version of WT-NMP now monitors and restarts crashed php-cgi processes.

idragosalex
  • 146
  • 4
0

What else could cause the php-cgi to stop running?

This is caused by bugs in PHP. php-cgi is not really well maintained.

Are there any other options for logging that we could turn on that could help us track this down? Are there other log locations that we should be looking at?

Nope. You might find something in the Windows Eventlog. Run windbg with php-dev-sdk (debug symbols). http://www.windbg.org/

If you found something, attach the full debug trace and report the bug over at https://bugs.php.net/report.php

Jens A. Koch
  • 111
  • 3