错误代码:
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
感觉貌似我写的项目在本地都没错,为什么到云服务器上运行就错了!原来PHP 本身不需要事先声明变量即可直接使用,但是对未声明变量会有提示。一般作为正式的网站会把提示关掉的,甚至连错误信息也被关掉。可能我们书写不够规范!
解决方案:
①‘农村人’的想法:不如在每个头文件加个error_reporting(0);即可。这确实是不错的想法,但每个文件都要加,岂不是影响软件开发的效率了!你们说是吧!!
②'城市人'的做法:搞个全局的就好了,干嘛那么麻烦呀!
搜索php.ini:
error_reporting = E_ALL
改为:
error_reporting = E_ALL & ~E_NOTICE
差别就是这样!!哈哈,开玩笑的!其实我是个农村人但我做的城市的做法!!