- 目的
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
DocumentRoot "/var/www/html/test" # # Relax access to content within /var/www. # <Directory "/var/www"> AllowOverride None # Allow open access: Require all granted </Directory> # Further relax access to the default document root: <Directory "/var/www/html/test"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted
不足情報などありましたらご指摘ください。
ご教授いただけますと幸いです…
まだ回答がついていません
会員登録して回答してみよう