logo

Black Friday
Sale

  •  99.9% 가동시간
  •  무료 SSL 인증서
  •  24/7 라이브 지원
  •  30일 환불 보증
시작하기

최대

90

%

OFF

05
21
47
47
블랙프라이데이 세일: 웹호스팅
시작 요금 895원 /월!
전체 상품 보기
×

지식 창고

호스팅어의 호스팅 서비스와 관련된 정보글, 문제 해결 가이드,
기타 전문 정보글을 검색하세요.

PHP Fatal error: Cannot redeclare

Modified on:
PHP Fatal error PHP Fatal erro redeclare php redeclare function redeclare function PHP Fatal error Cannot redeclare

If you see error message 'PHP Fatal error: Cannot redeclare function' or similar error message in your script, it means there is a problem with your script code (it tries to declare the same function multiple times).

This error says that your function is already defined. This could mean:

  • you have the same function defined in two files
  • you have the same function defined in two places in the same file
  •  the file in which your function is defined is included two times (so, it seems the function is defined two times)

To help with the third point, a solution would be to use include_once instead of include when including your functions.php file -- so it cannot be included more than once.