php部署到云服务器出现异常

错误代码:

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 

差别就是这样!!哈哈,开玩笑的!其实我是个农村人但我做的城市的做法!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值