Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

3 Answers 3

up vote 0 down vote accepted

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.

share|improve this answer

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

share|improve this answer

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

share|improve this answer
    
How exactly does this address the problem as stated in the Question? –  Chris S Jun 19 at 20:00
    
Maybe you could add some details as to how this addresses the OP's issue. –  squillman Jun 19 at 20:01
    
I used to have the same problem <<PHP-CGI randomly stops running with no error log>> 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 at 20:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.