- 目的
laravelで都合上、ec2へphp7.1を入れなければいけず、どうにかインストールまでしたのですがphpページが表示されずapacheのテストページが表示されます。
phpページを表示できるようにしたいです。
- 状況
https://qiita.com/minato-naka/items/03f9dbd09eb3919a501f
↑こちらのページを参考にec2にphp7.1を入れようと
sudo amazon-linux-extras install -y php7.1
をしたら、サポートが切れており7.1を入れられませんでした。
そのあと
https://qiita.com/hiroita/items/0224ad48c0d600d92645
↑こちらのページを参考に
$sudo amazon-linux-extras install -y epel $sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-7.rpm $sudo yum install -y php71 php71-php-mbstring $sudo . /opt/remi/php71/enable sudo: .: コマンドが見つかりません $sudo ln -s /usr/bin/php71 /usr/bin/php $php -v PHP 7.1.33 (cli) (built: Nov 15 2021 10:33:44) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies $ sudo systemctl restart httpd
上記を行いました。
ぱっと見php7.1がインストールできてるのかなと思ったのですが
/var/www/html/test/index.php
が表示されずapacheのテストページが表示されます。
試しに
/var/www/html/test/index.html
にしたら表示されているのでphpの問題なのかなと思っていますが、ここからどうやったら良いのかわからず質問しました。
Apache設定については
https://qiita.com/minato-naka/items/03f9dbd09eb3919a501f
こちらの設定通り行ったつもりです。
httpd.conf
1DocumentRoot "/var/www/html/test" 2 3# 4# Relax access to content within /var/www. 5# 6<Directory "/var/www"> 7 AllowOverride None 8 # Allow open access: 9 Require all granted 10</Directory> 11 12# Further relax access to the default document root: 13<Directory "/var/www/html/test"> 14 # 15 # Possible values for the Options directive are "None", "All", 16 # or any combination of: 17 # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 18 # 19 # Note that "MultiViews" must be named *explicitly* --- "Options All" 20 # doesn't give it to you. 21 # 22 # The Options directive is both complicated and important. Please see 23 # http://httpd.apache.org/docs/2.4/mod/core.html#options 24 # for more information. 25 # 26 Options Indexes FollowSymLinks 27 28 # 29 # AllowOverride controls what directives may be placed in .htaccess files. 30 # It can be "All", "None", or any combination of the keywords: 31 # Options FileInfo AuthConfig Limit 32 # 33 AllowOverride All 34 35 # 36 # Controls who can get stuff from this server. 37 # 38 Require all granted
不足情報などありましたらご指摘ください。
ご教授いただけますと幸いです…

回答1件
あなたの回答
tips
プレビュー