1. 程式人生 > >php代碼常見錯誤詳解整理

php代碼常見錯誤詳解整理

eid his 下一步 數據庫 defaults home rep near discuz

錯誤類型:
一、未使用二進制上傳



代碼:
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)



七、查詢語句有錯誤

代碼:
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)



十、

代碼:
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

十一、這是語言管理中的language表裏面有些字段沒有引號,有些新增模塊有這樣的問題

代碼:
Boka SiteEngine
數據庫錯誤
錯誤信息1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘home‘]‘‘ at line 1



出現錯誤的查詢信息是
UPDATE boka_language

十二、不存在此函數

代碼:
Fatal error: Call to undefined function: buildhtml() in /usr/boka/www.lzj.bsa.cn/admin/news.php on line 894



十三、服務器執行時間超時.修改php.ini裏的設置

代碼:
Fatal error: Maximum execution time of 30 seconds exceeded in c:\program files\siteengine\siteenginephp\www\lib\tar.php on line 101 Fatal error: Maximum execution time of

30 seconds exceeded in c:\program files\siteengine\siteenginephp\www\lib\cookie.php on line 174



十四、調用了不存在的類

代碼:
Fatal error: Call to a member function on a non-object in e:\boka\d.com\admin\product.php on line 1291



十五、ZEND版本不匹配?

代碼:
Fatal error: Incompatible file format: The encoded file has format ID 2006022801, whereas the Optimizer can read up to 2002062301 in e:\website\d.com\install.php on line 0



十六、不能建立windows下的Mysql服務進程

代碼:
cannot create windows service for mysql.error:0



十七、數據表錯誤,修復數據表.(檢查數據庫的表。通過phpmyadmin即可修復)

代碼:
Discuz! info: MySQL Query Error

User: 球球媽
Time: 2006-7-26 10:50am
Script: /forums/redirect.php

SQL: SELECT f.fid, t.tid, f.*, ff.* , f.fid AS fid
FROM cdb_forums f, cdb_threads t
LEFT JOIN cdb_forumfields ff ON ff.fid=f.fid
WHERE t.tid=‘109118‘ AND t.displayorder>=‘0‘ AND f.fid=t.fid LIMIT 1
Error: Can‘t open file: ‘cdb_threads.MYI‘. (errno: 145)
Errno.: 1016

Similar error report has beed dispatched to administrator before.



十七,環境zend未安裝

代碼:
Zend Optimizer not installed



十八,安裝是沒有任何反應,輸入install.php面空白。
環境錯誤提示被屏蔽,察看文件是否用二進制傳送或者是zend是否有安裝。

十九、數據庫出現

代碼: [拷貝到剪貼板]
too many connections



數據庫鏈接數太多,修改mysql的最大鏈接數。

二十、輸入安裝install.php提示
install.php 不允許執行原因是:
腳本權限錯誤:不能設置為同組可寫!

服務器端配置:

Server Administrator/Contact: [no address given]
Server Name: www.***.com
Server Port: 80
Server Protocol: HTTP/1.1

訪問請求數據:

User Agent/Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)
Request Method: GET
Remote Address: 221.222.177.106
Remote Port: 30066

請檢查install.php的文件屬性是否為644。

二十一、訪問頁面提示:

代碼:
Warning: main(/data/home/zn00s1/htdocs/data/language/.php): failed to open stream: No such file or directory in /data/home/zn00s1/htdocs/admin/global.php on line 62



這個錯誤是由於數據庫恢復不正常。請核實2個數據庫的版本是否一致。

二十二、在2003下執行install.php文件,點擊"下一步"的按鈕點擊不下去.
請檢查2003下的IE的安全設置為中。

php代碼常見錯誤詳解整理