如何修复'require_once()无法打开流'

问题描述 投票:0回答:1

我正在建立一个网站,我必须访问核心文件夹中的init文件。我目前在包含文件夹detailsmodal.php文件中,该文件由onclick事件触发。我使用的路径

require_once './core/init.php';

当我点击模态时出错:

警告:require_once(./ core / init.php):无法打开流:第2行的C:\ xampp \ htdocs \ mednew \ includes \ detailsmodal.php中没有此类文件或目录

致命错误:require_once():在C:\ xampp \ htdocs \ mednew \ includes \ detailsmodal.php上打开所需的'./core/init.php'(include_path ='C:\ xampp \ php \ PEAR')失败2

https://gyazo.com/e17324da3caa48c342255bb4bfd1344d

php html
1个回答
0
投票
require_once('../../core/init.php');

我认为你前面有两个目录而不是一个。

© www.soinside.com 2019 - 2024. All rights reserved.