다음과 같은 오류가 발생한다면 PHP시간대 설정이 안되어있는 경우이다.
https://zetawiki.com/wiki/PHP_%EC%8B%9C%EA%B0%84%EB%8C%80_%EC%84%A4%EC%A0%95
* 확인
cat /etc/php.ini | grep timezone
* 수정
- sed로 수정
grep date.timezone /etc/php.ini
cp /etc/php.ini /etc/php.ini.old
sed -i 's/;date.timezone =/date.timezone = Asia\/Seoul/g' /etc/php.ini
diff /etc/php.ini.old /etc/php.ini
- 직접수정
vi /etc/php.ini
date.timezone = Asia/Seoul
위에처럼 주석을 제거하고 값을 넣어준다.
* 확인
php -r "echo date('Y-m-d H:i:s').PHP_EOL;"
service httpd restart
'개인공부 > CentOS, PHP, MySQL' 카테고리의 다른 글
Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation (0) | 2018.01.18 |
---|---|
Mysql(Mariadb) 한글깨짐 해결 (0) | 2017.12.22 |
Warning: mysqli::mysqli(): (HY000/2002): Permission denied in (0) | 2017.12.18 |
CentOS APM 설치 - 20171215 (0) | 2017.12.16 |
CentOS APM설치 명령어 (0) | 2017.12.15 |