4

Apache PHP クラッシュの原因を突き止めようとしています。これらのphpクラッシュの原因となっているコード、構成、または問題を追跡するのに役立つ、何らかの設定、ツール、または何かがあることを願っています。

私のWindowsイベントログには(Apacheのクラッシュを示していますが、phpが原因です):

Faulting application httpd.exe, version 2.2.21.0, time stamp 0x4e6b3136, faulting module php5ts.dll, version 5.3.8.0, time stamp 0x4e537a04, exception code 0xc0000005, fault offset 0x0000c7d7, process id 0xbf4, application start time 0x01cd45afc42f0b7d.

このアプリケーションは、Windows Server 2008 マシン (xampp) で Apache、PHP、および MySQL を利用します。

これは私のApacheログのクラッシュです:

[Fri Jun 08 15:56:34 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Fri Jun 08 15:56:35 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:56:35 2012] [notice] Digest: done
[Fri Jun 08 15:56:35 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations
[Fri Jun 08 15:56:35 2012] [notice] Server built: Sep 10 2011 11:34:11
[Fri Jun 08 15:56:35 2012] [notice] Parent: Created child process 1220
[Fri Jun 08 15:56:35 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:56:35 2012] [notice] Digest: done
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Child process is running
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Acquired the start mutex.
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting 150 worker threads.
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting thread to listen on port 80.
[Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting thread to listen on port 80.
[Fri Jun 08 15:57:37 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
[Fri Jun 08 15:57:37 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:57:37 2012] [notice] Digest: done
[Fri Jun 08 15:57:37 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations
[Fri Jun 08 15:57:37 2012] [notice] Server built: Sep 10 2011 11:34:11
[Fri Jun 08 15:57:37 2012] [notice] Parent: Created child process 3932
[Fri Jun 08 15:57:38 2012] [notice] Digest: generating secret for digest authentication ...
[Fri Jun 08 15:57:38 2012] [notice] Digest: done
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Child process is running
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Acquired the start mutex.
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting 150 worker threads.
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting thread to listen on port 80.
[Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting thread to listen on port 80.

私が何を試すべきか、またはどのコードを追跡するためのツール/テクニックなどがこれを引き起こしているのかについての考えはありますか?

4

1 に答える 1

2

XAMPP の Apache (Windows 用) はwinn_nt MPM (マルチスレッド) + スレッドセーフ PHP で構築されているため、おそらくスレッドセーフ バージョンの PHP に固有の問題に遭遇している可能性があります (詳細については、この非常に優れた投稿を参照してください)。情報)。これは、シングル ユーザー モードで実行しているときにエラーが発生しない理由を説明している可能性があります。

Uku Loskit の提案が役に立ったかどうかお知らせください。そうでない場合は、そのようなマルチユーザー環境で Prefork + Non-Thread-Safe PHP セットアップに切り替えることをお勧めします。

MPM はコンパイル時に選択する必要があるため、次のいずれかを行う必要があります。

  • Apache を自分でコンパイルします (技術的には可能ですが、私が覚えている限り、Windows ではかなり苦労しました)。
  • プリフォークで構築されたXAMPP以外のディストリビューションを見つけます(私は何も知りません)

おそらく、 FastCGIを使用して PHP を実行することをお勧めします(この追加のレイヤーは、基本的に、スレッドごとに個別の PHP プロセスを開始することでサーバー スレッドを分離します)。これにより、私の最初の仮定を十分に簡単に確認できるはずです。

補足: Windows Server に Apache をインストールする意味がわかりません。IIS を使用するか、オプションで FastGCI を使用するか (こちらの手順を参照)、または (より良い) Linux ベースのスタックに切り替えることを検討することをお勧めします

于 2012-07-03T00:23:49.947 に答える