公司目前生产上有四台服务器,现新增一台服务器,作为专门对外的接口服务器,由于现在的服务器不是统一的配置,有些是最近增加的,有些是很早之前的,在这次新增的时候,着实踩了好几个坑
1.php.ini文件中的配置
从其中一个服务器A,拷贝了php.ini到新增的服务器上,问题来了,一直报(session是用memecache来保存的)
PHP Fatal error: session_start(): Failed to initialize storage module: memcache (path: /tmp)
A服务器 在phpinfo()中session.save_path是有值的,但是php.ini中却配置了 /tmp 经过一番查找,php有多个扩展的*.ini文件,session.save_path在扩展的配置文件中
2.php_errors.log
php的错误日志报 register_long_arrays 以及下面的错误
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'
在Php.ini中添加下面的配置
register_long_arrays = Off date.timezone = Asia/Chongqing
3.目录权限问题
由于使用了smarty模板解析引擎,需要将其解析之后存放文件的目录修改为和代码一直的用户和用户组
/opt/www/crm/template_c目录的用户组及用户应为apache
4.公司内部的一个将系统解耦的服务需要启动
5.发现好多页面加载的时间太长,通过xhprof观察调用curl的时候耗费了很长的时间
最后没有办法,让运维直接在服务器上curl访问接口,发现也耗费了很长的时间
通过Ping发现,指向错误
终极解决办法,将/etc/hosts中的所有配置全部删除,结果页面就可以正常访问了
6.xhprof的添加
xhprof添加了,但是不能查看图片,缺少graphviz包