Accept cookies for analytics, social media, and advertising, or learn more and adjust your preferences. These cookies are on by default for visitors outside the UK and EEA. Privacy Notice.
NGINX は FastCGIデーモンを使ってWindows上でPHPとやり取りをすることができます。これはPHPと同梱されています: php-cgi.exe。php-cgi.exe -b 127.0.0.1:<port>
を実行し、NGINXの設定ファイル内で fastcgi_pass 127.0.0.1:<port>;
を使う必要があります。起動された後でphp-cgi.exe
はコマンドプロンプト ウィンドウ内で接続のためにlistenし続けるでしょう。windowsを隠すために、小さなユーティリティRunHiddenConsoleを使います。
php-cgi.exe
が php.exe
と同じディレクトリ内にインストールされるようにして、PHPのWindowsバイナリをインストールします。c:\nginx\
の中に)バッチファイルstart-php-fcgi.bat
を作成します。start-php-fcgi.bat
@ECHO OFF ECHO Starting PHP FastCGI... set PATH=C:\PHP;%PATH% c:\bin\RunHiddenConsole.exe C:\PHP\php-cgi.exe -b 127.0.0.1:9123nginx.conf
root c:/www; location ~ \.php$ { fastcgi_pass 127.0.0.1:9123; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
C:\nginx
内でSYSTEM アカウントの下でシステム起動時にC:\nginx\conf\start-nginx.bat
ファイルを実行するように基本的(Windows Vista)タスクをスケジュールします。cd /d C:\cygwin\bin && bash -c /usr/local/nginx/sbin/nginx