본문 바로가기

AWS/※에러※

Wordpress 설치 에러: front to the wordpress application. this file doesn't do anything, but loads

반응형

 

문제 발생 이유

php 설치가 안됨

 

 

해결 방법 1: php 설치

 

나의 경우에는 인스턴스 생성 시 php가 설치 차제가 안됐다.

 

 

이하 EC2 인스턴스 사용자 데이터(user data) 코드

#! /bin/bash
yum install -y httpd
amazon-linux-extras enable php7.4
yum install -y php php-cli php-pdo php-fpm php-json php-mysqlnd mariadb
wget https://ko.wordpress.org/wordpress-5.7.8-ko_KR.tar.gz
tar xvfz wordpress-5.7.8-ko_KR.tar.gz
cp -a ./wordpress/* /var/www/html/
chown apache.apache /var/www/html/*
sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php/g' /etc/httpd/conf/httpd.conf
cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
sed -i 's/database_name_here/wordpress/g' /var/www/html/wp-config.php
sed -i 's/username_here/root/g' /var/www/html/wp-config.php
sed -i 's/password_here/12345678/g' /var/www/html/wp-config.php
sed -i 's/localhost/RDS엔드포인트/g' /var/www/html/wp-config.php
cat > /var/www/html/index.html << EOF
<html><body><h1>AWS-WEBSERVER</h1></body></html>
EOF

systemctl enable httpd
systemctl start httpd

 

 

직접 명령어를 실행해보니

 

 

command not found에서 뭔가 이상함을 감지.

 

 

해결 방법 2: php가 설치가 안된다면 OS 재확인 후 설치

 

알고보니 인스턴스 OS가 Amazon Linux 2023 로 설치돼있었다.

 

Amazon Linux 2로 재시도하니 오류 해결.

 

 

 

 

 

 

반응형