M1 아이맥 기준으로 2022.02.06일 기준 워드프레스 최신 버전과 php8 버전의 연동은 아직 시기상조이다.
만약 그렇게 셋팅하면 아래와 같은 갖은 에러가 창궐한다.
[Tue Feb 01 18:35:39.029478 2022] [php:warn] [pid 7980] [client 170.187.155.78:30548] PHP Warning: Undefined array key “host” in /opt/homebrew/var/www/wp-includes/canonical.php on line 696
[Tue Feb 01 18:35:39.029483 2022] [php:warn] [pid 7980] [client 170.187.155.78:30548] PHP Warning: Undefined array key “host” in /opt/homebrew/var/www/wp-includes/canonical.php on line 699
[Tue Feb 01 18:35:39.029488 2022] [php:warn] [pid 7980] [client 170.187.155.78:30548] PHP Warning: Undefined array key “scheme” in /opt/homebrew/var/www/wp-includes/canonical.php on line 720
[Wed Feb 02 14:19:50.854913 2022] [core:error] [pid 7980] [client 45.146.165.37:60668] AH10244: invalid URI path (/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh)
[Wed Feb 02 15:43:42.909769 2022] [php:error] [pid 27886] [client 185.103.199.185:27231] script ‘/opt/homebrew/var/www/accesson.php’ not found or unable to stat
[Thu Feb 03 00:00:02.568211 2022] [php:warn] [pid 27886] [client 40.77.167.79:40576] PHP Warning: Attempt to read property “post_type” on null in /opt/homebrew/var/www/wp-includes/class-wp-query.php on line 4273
[Thu Feb 03 00:00:02.568643 2022] [php:warn] [pid 27886] [client 40.77.167.79:40576] PHP Warning: Attempt to read property “post_type” on null in /opt/homebrew/var/www/wp-includes/class-wp-query.php on line 4273
혹시나 이미 brew를 사용하여 php8을 설치하였다며
brew install php7@7.4
– 설치후 나오는 안내에 따라 httpd.conf 수정 및 php start등 수행
brew remove php8
– 기존 php8 삭제
brew services restart php7@7.4
brew services restart httpd
명령어등으로 php7.4버전으로 버전다운 해주시면 되겠다.
wordpress + php7