PHP運(yùn)行出現(xiàn)Notice : Use of undefined constant 的完美解決方案分享
Notice: Undefined index: EaseTemplateVer in E:\Server\vhosts\www.lvtao.net\libs\template.core.php on line 51
Notice: Use of undefined constant uid - assumed 'uid' in E:\Server\vhosts\www.lvtao.net\global.php on line 54
Notice: Undefined index: uid in E:\Server\vhosts\www.lvtao.net\global.php on line 54
Notice: Use of undefined constant cuid - assumed 'cuid' in E:\Server\vhosts\www.lvtao.net\global.php on line 55
Notice: Undefined index: cuid in E:\Server\vhosts\www.lvtao.net\global.php on line 55
Notice: Use of undefined constant shell - assumed 'shell' in E:\Server\vhosts\www.lvtao.net\global.php on line 56
Notice: Undefined index: shell in E:\Server\vhosts\www.lvtao.net\global.php on line 56
Notice: Use of undefined constant cshell - assumed 'cshell' in E:\Server\vhosts\www.lvtao.net\global.php on line 57
Notice: Undefined index: cshell in E:\Server\vhosts\www.lvtao.net\global.php on line 57
Notice: Use of undefined constant username - assumed 'username' in E:\Server\vhosts\www.lvtao.net\global.php on line 58
Notice: Undefined index: username in E:\Server\vhosts\www.lvtao.net\global.php on line 58
Notice: Use of undefined constant cusername - assumed 'cusername' in E:\Server\vhosts\www.lvtao.net\global.php on line 59
Notice: Undefined index: cusername in E:\Server\vhosts\www.lvtao.net\global.php on line 59
Notice: Use of undefined constant id - assumed 'id' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 10
Notice: Use of undefined constant id - assumed 'id' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 14
Notice: Use of undefined constant content - assumed 'content' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 16
Notice: Use of undefined constant content - assumed 'content' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 16
Notice: Use of undefined constant description - assumed 'description' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 17
Notice: Use of undefined constant description - assumed 'description' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 17
Notice: Use of undefined constant provinceid - assumed 'provinceid' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 18
Notice: Use of undefined constant cityid - assumed 'cityid' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 19
Notice: Use of undefined constant hy - assumed 'hy' in E:\Server\vhosts\www.lvtao.net\companyjob.php on line 20
Notice: Undefined variable: content in E:\Server\vhosts\www.lvtao.net\libs\template.core.php on line 557
進(jìn)入網(wǎng)站會(huì)出現(xiàn)大量類似下面的提示,但是可以正常顯示和運(yùn)行
Notice: Use of undefined constant ctbTitle - assumed 'ctbTitle' in d:\ctb1.5\ctb\include\config.php on line 23...
b答案:這些是 PHP 的提示而非報(bào)錯(cuò),PHP 本身不需要事先聲明變量即可直接使用,但是對(duì)未聲明變量會(huì)有提示。一般作為正式的網(wǎng)站會(huì)把提示關(guān)掉的,甚至連錯(cuò)誤信息也被關(guān)掉
關(guān)閉 PHP 提示的方法
搜索php.ini:
error_reporting = E_ALL
改為:
error_reporting = E_ALL & ~E_NOTICE
還有個(gè)不是辦法的辦法就是
在每個(gè)文件頭上加
error_reporting(0); 雖然不好弄但是可以解決問題!?。。。?!這個(gè)比較好用
- 淺談ThinkPHP中initialize和construct的區(qū)別
- ThinkPHP中類的構(gòu)造函數(shù)_construct()與_initialize()的區(qū)別詳解
- PHP正則替換函數(shù)preg_replace()報(bào)錯(cuò):Notice Use of undefined constant的解決方法分析
- php類中的$this,static,final,const,self這幾個(gè)關(guān)鍵字使用方法
- ThinkPHP中__initialize()和類的構(gòu)造函數(shù)__construct()用法分析
- 解析php中static,const與define的使用區(qū)別
- php面向?qū)ο笕ヂ?(十) final static const關(guān)鍵字的使用
- PHP const定義常量及global定義全局常量實(shí)例解析
相關(guān)文章
php以fastCGI的方式運(yùn)行時(shí)文件系統(tǒng)權(quán)限問題及解決方法
在IIS7.0上以FastCGI方式配置好PHP運(yùn)行環(huán)境,測試可以正常運(yùn)行PHP程序后,將PHP程序部署上去,導(dǎo)入程序原來的數(shù)據(jù)和配置信息。很快就有問題出來啦下面我們就詳細(xì)記錄下。2015-05-05
php自定義函數(shù)br2nl實(shí)現(xiàn)將html中br換行符轉(zhuǎn)換為文本輸入中換行符的方法【與函數(shù)nl2br功能相反】
這篇文章主要介紹了php自定義函數(shù)br2nl實(shí)現(xiàn)將html中br換行符轉(zhuǎn)換為文本輸入中換行符的方法,具有與函數(shù)nl2br相反的功能,并附帶了相應(yīng)的JS實(shí)現(xiàn)方法,需要的朋友可以參考下2017-02-02
php通過array_merge()函數(shù)合并兩個(gè)數(shù)組的方法
這篇文章主要介紹了php通過array_merge()函數(shù)合并兩個(gè)數(shù)組的方法,實(shí)例分析了php中array_merge()函數(shù)合并數(shù)組的使用技巧,需要的朋友可以參考下2015-03-03
在WINDOWS中設(shè)置計(jì)劃任務(wù)執(zhí)行PHP文件的方法
在網(wǎng)上找了些WINDOWS執(zhí)行PHP的計(jì)劃任務(wù)的方法,有一個(gè)寫得很全,可惜在我這竟然沒通過。最后不得不綜合各門派的方法,才能在我這運(yùn)行成功2011-12-12
PHP實(shí)現(xiàn)將幾張照片拼接到一起的合成圖片功能【便于整體打印輸出】
這篇文章主要介紹了PHP實(shí)現(xiàn)將幾張照片拼接到一起的合成圖片功能,可實(shí)現(xiàn)多張圖片的合并,便于整體打印輸出.涉及php字符串、數(shù)組的遍歷、排序及圖片合成、裁剪、縮放等相關(guān)操作技巧,需要的朋友可以參考下2017-11-11
PHP使用Session實(shí)現(xiàn)上傳進(jìn)度功能詳解
這篇文章主要介紹了PHP使用Session實(shí)現(xiàn)上傳進(jìn)度功能,結(jié)合實(shí)例形式詳細(xì)分析了session上傳進(jìn)度顯示相關(guān)原理、實(shí)現(xiàn)方法及操作注意事項(xiàng),需要的朋友可以參考下2019-08-08
golang 調(diào)用 php7詳解及實(shí)例
這篇文章主要介紹了golang 調(diào)用 php7詳解及實(shí)例的相關(guān)資料,需要的朋友可以參考下2017-01-01
PHP使用PDO操作sqlite數(shù)據(jù)庫應(yīng)用案例
這篇文章主要介紹了PHP使用PDO操作sqlite數(shù)據(jù)庫,結(jié)合實(shí)例形式分析了php基于yaf框架使用pdo操作sqlite數(shù)據(jù)的相關(guān)原理、步驟與操作技巧,需要的朋友可以參考下2019-03-03
PHP中Header使用的HTTP協(xié)議及常用方法小結(jié)
這篇文章主要介紹了PHP中Header使用的HTTP協(xié)議及常用方法,包含了各種錯(cuò)誤編碼類型及其含義,需要的朋友可以參考下2014-11-11

