検索条件
お知らせ
現在サイトのリニューアル作業中のため、全体的にページの表示が乱れています。
Env |
Ver |
OS |
Ubuntu 20.04.4 LTS |
PHP |
8.0.29 |
nginx |
1.18.0 |
sudo apt install php8.0-fpm
sudo sed -i -e 's/;listen.mode = 0660/listen.mode = 0666/' /etc/php/8.0/fpm/pool.d/www.conf
sudo service php8.0-fpm start
設定ファイルを開きPHPを動かす設定を書く
location ~ ^/.*$ {
root /path/to/www;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
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
ファイルにアクセス