PHP常见错误类型及排查详解
常见PHP错误类型解析:
一、未使用二进制模式上传文件
相关代码示例:
Fatal error: This encoded file is corrupted. Please refer to http://www.zend.com/support/support_faq.php?id=loader_file_corrupt for further help in
/webhome/****.com/web/www/index.php on line 0
二、数据表中缺少所需字段
相关代码示例:
An error was encountered
Boka SiteEngine
数据库错误
错误信息1054: Unknown column 'tuijian' in 'where clause'
出现错误的查询语句如下
SELECT * FROM boka_product WHERE tuijian=1 AND classid IN ('1','0')ORDER BY id DESC LIMIT 4
三、服务器限制了网站使用内存的大小为8M,当前已超出限制
相关代码示例:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 5898240 bytes)
四、模板文件存在语法错误,header.php的第529行调用的模板中,其第79行出错
[code]in /webhome/***.com/web/www/header.php(529) : eval()'d code on line 79
五、数据库表不存在
相关代码示例:
An error was encountered
Boka SiteEngine
1146: Table 'test.boka_settings' doesn't exist
SELECT value FROM boka_settings WHERE variable='defaultstyleid'
六、未安装系统或数据库用户名密码错误
相关代码示例:
An error was encountered
Boka SiteEngine
1045: Access denied for user: 'root@localhost' (Using password: YES)
七、SQL查询语句存在语法错误
相关代码示例:
Boka SiteEngine
数据库错误
错误信息1064: You have an error in your SQL syntax near 'ORDER BY sequence ASC,id ASC' at line 1
出现错误的查询语句如下
UPDATE gzhy_newsclass SET ishidden ='1' WHERE id = '38' ORDER BY sequence ASC,id ASC
八、授权文件已过期
相关代码示例:
There is a fatal error,the file has expired
九、数据库连接失败,需要修复数据库或者重新启动数据库服务
相关代码示例:
An error was encountered
Boka SiteEngine
2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
十、PHP解析错误
相关代码示例:
Warning: Unexpected character in input: '' (ASCII=4) state=1 in c:\program files\siteengine\siteenginephp\www\index.php on line 97
Warning: Unexpected character in input: '' (ASCII=5) state=1 in c:\program files\siteengine\siteenginephp\www\index.php on line 97
Parse error: parse error, unexpected T_STRING in c:\program files\siteengine\siteenginephp\www\index.php on line 97
12下一页阅读全文