1 首先您要清楚 Warning 提示 根本不是错误报错,在PHP.ini 报错设置里面 设置一下就可以 ; Examples: ; ; - Show all errors, except for notices and coding standards warnings ; ;error_reporting = E_ALL & ~E_NOTICE ; ; - Show all errors, except for notices ; ;error_reporting = E_ALL & ~E_NOTICE | E_STRICT ; ; - Show only errors ; ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR ; ; - Show all errors except for notices and coding standards warnings ; error_reporting = E_ALL & ~E_NOTICE; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = On error_reporting 是设置 报错的范围 如果你要关闭报错 只需要 将 display_errors 改成 OFF就可以了 或者在 php程序里面加上 error_reporting(0); 就可以了 2 就是包含文件路径问题,首先你要确定文件存在。 路径没有问题。。
我也遇到过这种问题,在zend下测试网页的时候产生这种情况,但是在浏览器下没有问题
问题不是include_path的问题。一般的include_path都会包含本目录(.)。
而且你的现在也已经带了。
如果你要检查,php.ini里有设置选项。
include_path='.;C:\php5\pear'
包含当前路径(./)了.
如果楼主使用zend studio 开发,并且是在zend studio中调试的话(如5楼所述),
建议楼主看下下面的目录
zend studio安装目录\ZendStudio-5.5.0\bin\php5
在该目录里还有个php.ini文件,在调试时,zend studio 是使用该php.ini调试的
;
; - Show all errors, except for notices and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE
;
; - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
;
; - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
; - Show all errors except for notices and coding standards warnings
;
error_reporting = E_ALL & ~E_NOTICE; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On error_reporting 是设置 报错的范围 如果你要关闭报错 只需要 将 display_errors 改成 OFF就可以了
或者在 php程序里面加上 error_reporting(0); 就可以了
2 就是包含文件路径问题,首先你要确定文件存在。 路径没有问题。。
要改成绝对路径index.php 中的引用改成
include_once(dirname(__FILE__).'/sysadm/configs/conn.php')其他类似
另include_once只给警告,require_once则致命错误
Parse error: syntax error, unexpected T_IF in C:\Inetpub\wwwroot\test\sysadm\configs\conn.php on line 4
——————————————————————语法错误,第3行可能后面没有用‘;’结束,或者是其他语法错误
include_path='.;C:\php5\pear;你的站点绝对路径';
装好以后缺省设置就很好用了