我在命令行里运行php文件时,有语法错误也不提示,什么都不输出,没有错误的时候能正确的输出运行结果(网页源码)。我在editplus里配置调试功能的时候,有语法错误也不提示错误信息,只输出“输出完成 (耗时 0 秒) - 正常终止”,没有错误的时候能正确输出。请问是不是我的php配置文件不正确,导致php运行的时候不列出语法错误啊,谢谢。PHP语法错误命令行Editplus

解决方案 »

  1.   

    没打开错误提示功能吧。
    ini文件中
    display_errors
      

  2.   

    自己设置下http://php.net/manual/en/function.error-reporting.php<?php// 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
    // This is the default value set in php.ini
    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);?>
      

  3.   

    你指的是php warning屏蔽操作