下記のようにアクセスして簡単なページ確認がしたいです。
http://ドメイン名/index.php
nginxでphpのCGI環境を作ろうと
下記サイトなど見ながらするとnginxの再起動で失敗します。
https://qiita.com/noraworld/items/fd491a77af9d4e1ccffa
・エラー内容
nginx:$ sudo service nginx restart
[emerg] "location" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
$vi /home/ユーザ名/www/index.php <?php phpinfo(); ?> $ sudo vi /etc/nginx/conf.d/default.conf location / { root /home/ユーザ名/www; index index.php; } location ~ .php$ { root /home/ユーザ名/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
わかる方いらっしゃいますでしょうか?
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/25 07:18
2018/10/25 07:21 編集
2018/10/25 07:26
2018/10/25 07:26
2018/10/25 07:31
2018/10/25 07:33
2018/10/25 07:37
2018/10/25 07:40 編集
2018/10/25 07:47
2018/10/25 07:49
2018/10/25 08:38
2018/10/25 09:27
2018/10/26 01:38