PHP命令行运行时,不列出语法错误信息

Terry_1314 2013-10-01 04:25:30
我在命令行里运行php文件时,有语法错误也不提示,什么都不输出,没有错误的时候能正确的输出运行结果(网页源码)。我在editplus里配置调试功能的时候,有语法错误也不提示错误信息,只输出“输出完成 (耗时 0 秒) - 正常终止”,没有错误的时候能正确输出。请问是不是我的php配置文件不正确,导致php运行的时候不列出语法错误啊,谢谢。
...全文
188 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
流vs觞 2013-10-09
  • 打赏
  • 举报
回复
你指的是php warning屏蔽操作
iasky 2013-10-01
  • 打赏
  • 举报
回复
自己设置下 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);

?>
ohmygirl 2013-10-01
  • 打赏
  • 举报
回复
没打开错误提示功能吧。 ini文件中 display_errors

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧