728x90
Error, Warning 안나오게 하기 (에러, 경고)
1 2 3 4 5 | <? error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); ?> | cs |
에러가 나오는 경우 코드 가장 윗쪽에 위의 코드를 추가 해도 되고, 오류가 나는 구문 앞에 @(골뱅이) 를 붙여도 에러가 무시 된다
추가 적인 내용은
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <? // Turn off all error reporting error_reporting(0); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // Report all errors except E_NOTICE error_reporting(E_ALL & ~E_NOTICE); // Report all PHP errors (see changelog) error_reporting(E_ALL); // Report all PHP errors error_reporting(-1); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?> | cs |
를 참고 해주고, 공식문서는 http://php.net/manual/en/function.error-reporting.php
'개발이야기 > PHP' 카테고리의 다른 글
php 이미지 리사이징(image resizing) (2) | 2018.02.22 |
---|---|
curl을 이용하여 post, get 방식 으로 데이터 전송하기 (0) | 2018.02.13 |
우분투(Ubuntu) 에서 PHP 설치 하기 (0) | 2018.02.08 |
PHP로 압축파일(Zip)파일을 만들어 보자 (3) | 2018.02.07 |
PHP 시간, 날짜 함수의 모든 것 (0) | 2018.02.05 |