###実現したいこと
新年早々失礼します。
ただいま、CentOS7.3にてNginxを使ったwordpress構築を行おうとnginxのインストールまでは行えたのですが、PHPのインストールの仕方で詰まっております。
多くのサイトが、epelもしくはremiの使用を推奨しており正直どっちを使えばいいのか分かりません。
またnginxのインストールはnginxの公式サイトにインストール手順及びレポジトリについて詳しく書いてあったのでそちらを使い、epelもしくはremiのインストールは行っていません。
###発生している問題・エラーメッセージ
PHPのインストール(PHP7.0もしくは7.1のインストールの仕方)
###Nginxのdefault.conf
vim
1server { 2 listen 80; 3 server_name localhost; 4 5 #charset koi8-r; 6 #access_log /var/log/nginx/log/host.access.log main; 7 8 location / { 9 root /usr/share/nginx/html; 10 index index.html index.htm; 11 } 12 13 #error_page 404 /404.html; 14 15 # redirect server error pages to the static page /50x.html 16 # 17 error_page 500 502 503 504 /50x.html; 18 location = /50x.html { 19 root /usr/share/nginx/html; 20 } 21 22 # proxy the PHP scripts to Apache listening on 127.0.0.1:80 23 # 24 #location ~ \.php$ { 25 # proxy_pass http://127.0.0.1; 26 #} 27 28 # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 29 # 30 #location ~ \.php$ { 31 # root html; 32 # fastcgi_pass 127.0.0.1:9000; 33 # fastcgi_index index.php; 34 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 35 # include fastcgi_params; 36 #} 37 38 # deny access to .htaccess files, if Apache's document root 39 # concurs with nginx's one 40 # 41 #location ~ /\.ht { 42 # deny all; 43 #}
###試したこと
一応、PHPのインストールはyumを通じてバージョン5.4あたりでインストールできました。
でも、せっかくなのでPHP7.0~7.1でインストールしたい。
###補足情報(言語/FW/ツール等のバージョンなど)
nginxは/etc/yum.repos.d/nginx.repoにbaseurlを追記し、インストールしました。
他サイトをいろいろ見ていると、バーチャルホストだなんだかんだと書いてありましたがこのままdefault.confを編集してはいけないのでしょうか。
なにぶん、webサーバを建てること自体初めてなのでいきなりnginxから始めたのがいけなかったとは思うのですが気長にご教授いただけたら幸いです。