解决PHP项目部署报Could not connect: No such file or directory

部署一个PHP项目时报这个,最终发现是PHP连接MySQL时报:

Could not connect: No such file or directory

解决

首先输出参数观察是否有问题,最终确定参数未获取到,而基于框架的限制来看需要通过include_path,找到conf文件,通过手工重设include_path可以解决

set_include_path(get_include_path() . PATH_SEPARATOR . 'xxxxx/conf/conf.php');
0条留言