现在的位置: 首页 > 综合 > 正文

php找不到php.ini的解决办法

2018年02月03日 ⁄ 综合 ⁄ 共 615字 ⁄ 字号 评论关闭

今天安装了一个php,用源码安装的,安装后发现没有php.ini文件,导致运行php的时候会出现一段错误

Warning: strftime(): 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 /home/autotest/software/php/lib/php/Smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 169

这个是时区的问题,解决方法是修改php.ini文件的date.timezone = PRC

后来发现没有php.ini文件,所以从安装目录下copy了php.ini-development或者php.ini-production到/etc/或者/usr/local/lib下,重命名为php.ini即可

抱歉!评论已关闭.