安装vmall5:从ebak恢复数据,需要配置php.ini

本文介绍了在部署PHP网站过程中遇到的三个常见问题及解决方案:1) PHP短标签未开启导致的语法错误;2) 数据库未指定引发的连接问题;3) 时区设置不当引起的日期警告。通过调整php.ini配置文件,并重启HTTP服务,成功解决了这些部署难题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

上传vmall5源码到服务器后访问ebak目录,发现网页不显示。用xshell登录到服务器手动执行ebak/index.php查看输出,发现这样一个错误:

PHP Parse Error: syntax error, unexpected $end ,blablabla...

这是因为php没有开启短标签。在php.ini中找到并设定:

short_open_tag = On

另一个错误,直接php解释执行根目录的index.php发现说数据库没有指定。那就到报错的文件,手动指定:

vim /var/www/html/app.hzyuanjian.cn/app/frontend.base.php +565
$mod->db->query('use my_database');

第三个错误是时区问题。依然执行根目录的index.php,提示说

PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /var/www/html/xxxxxx/eccore/controller/message.base.php on line 180

解决办法:依旧是修改php.ini,找到并修改为:

date.timezone = "Asia/Shanghai"

然后,重启httpd进程:

service httpd restart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值