Web/PHP

[PHP 에러 해결하기] PHP message: PHP Warning: phpinfo() It is not safe to rely on the system's timezone settings

Hannah_ko 2020. 10. 13. 14:11
SMALL

 

PHP 설치하기

2020/09/29 - [Web/Nginx] - Nginx에 php-fpm 설치하기 for Centos7

 

Nginx에 php-fpm 설치하기 for Centos7

Centos 환경에서 nginx를 설치한 후 php-fpm을 설치하여 환경설정을 셋팅해보는 방법을 알아보자. 1. 먼저 php-fpm을 설치한다. $ yum install -y php php-fpm php-mysql 이후 DB 추가 설치를 위해 php-mysql도 함..

eusun0830.tistory.com

 

PHP를 설치하고 phpinfo 파일로 테스트 할 때 로그에

 

FastCGI sent in stderr: "PHP message: PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.

 

 

이런 경고가 뜬다면 타임존 설정이 안 되어있다는 것이다.

 

그럴 때는 리눅스 centos 7 기준 /etc/php.ini 파일의 타임존을 설정해주면 된다.

 

$ vi /etc/php.ini

...
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Seoul

 

LIST