【nginx】php项目转移index.php中realpath($system_path)返回bool(false)

之前公司的网站是使用phpstudy跑在window上,现在转换到Linux上,LNMP环境环境已经搭建好,但是访问index.php出现了错误
错误如下:

Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php

这是index.php文件中跳出的错误,看着应该是说路径找不到,但是我单独打印$system_path是有值的,有没有大神遇到过这个问题,是不是php还是nginx的配置缺了什么内容,请各位大神指导,新手菜鸟在【nginx】php项目转移index.php中realpath($system_path)返回bool(false)此感激不尽

是不是php的配置或者nginx的配置缺少了什么,麻烦各位大佬指导,谢谢

回答

dump($system_path) 一下,看看出来什么

这里你提供的代码不多,
一句句来,
现假设
chdir(dirname(__FILE__)) 这句执行成功了,

根据你dump出来 realpath 为../system

假设你的index.php 存在在类似 /home/wwww/root/index.php

哪/home/wwww/system system文件夹应该在这个位置

如果这个位置没有system 这个目录,哪realpath当就返回false

这里报错了,虽然$system_path有值,很显然这个值所指向的目录路径不存在存在。

以上是 【nginx】php项目转移index.php中realpath($system_path)返回bool(false) 的全部内容, 来源链接: utcz.com/a/84630.html

回到顶部