php Yii: 出现undefined offset 或者 undefined index解决方案

今天将程序移植到远程服务器中出现很多异常的错误,本地没有任何错误,到服务器之后出现各种问题。现将首次遇到的问题进行总结后期将不断对此进行更新


1.php Yii: 出现undefined offset 或者 undefined index解决方案

解决方式: 修改php.ini中配置,没有则增加

log_errors = On
error_log = "/usr/local/lnmp/php/var/log/error_log"
error_reporting=E_ALL&~E_NOTICE

记得要重启Apache/ngnix哦


2.无法使用exec()函数 Warning: exec() has been disabled for security reasons in  

exec()函数无法使用

程序报错:Warning: exec() has been disabled for security reasons in

原因:在php.ini中存在 disable_functions配置,默认配置中,cli执行函数都是被 禁止的,如果需要的话,需要在php.ini中将 disable_functions = exec , popen, system …. ,将你需要执行的函数从列表中删掉在重启apache即可 。

完全是配置的问题。

php-apache2handler.ini

php.ini

disable_functions = proc_open, popen, exec, system, shell_exec, passthru


@author   www.yiicms.net

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值