CentOS에서 "php file.php"로이 프로그램을 실행하면 출력이 표시되지 않지만 PHP -l은 오류가 있음을 나타냅니다 (EOT가 누락 된 경우). 이 경우 오류보고를 활성화하려면 어떻게합니까?PHP 명령 줄 실행에 오류가 표시되지 않습니다.
<?php
ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);
$str = $_POST['name'];
file_put_contents("out.txt",$str);
print <<<EOT
<html><body><h1>You've entered $str</h1></body></html>
EOT
[1]
내가 겪었어요 [여기 이미지 설명 입력] :! -1 대신 E_ALL하기 위해 error_reporting를 설정하는 How to get useful error messages in PHP?
스크립트에 구문 오류가있는 경우 스크립트를 실행할 수 없습니다. 그래서 display_errors 설정은 실행될 수 없으므로 의미가 없습니다. 실제로 실행하려고 할 때 구문 분석 오류가 표시되어야합니다. –
닫는 'EOT'뒤에 오류가 누락되었습니다. –