Windows + nginxでPHPを動作させる
更新日:
投稿日:
投稿日:
確認環境
| Env | Ver |
|---|---|
| Windows | 10 pro |
| PHP | 8.0.2 NTS Visual C++ 2019 x64 |
| nginx | 1.19.8 |
手順
nginx.confを開きFastCGI server listening on 127.0.0.1:9000辺りに次の設定をする
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
- 設定したフォルダに
.phpファイルを配置 nginxを起動php-cgi.exe -b 127.0.0.1:9000.phpファイルにアクセス
サービス化する
- winswを使うとできるらしい