php - 警告:require_once(/home/orgdevelopers.tk/public_html/ok/app/Config/constant.php):无法打开流:没有这样的文件或目录
问题描述
你可以看到http://orgdevelopers.tk/api/app/Config/core.php
我的 php 版本的错误是7.0.33
. 执行 PHP 文件时出现此错误。请帮忙。
{Warning: require_once(/home/orgdevelopers.tk/public_html/ok/app/Config/constant.php): failed to open stream: No such file or directory in /home/orgdevelopers.tk/public_html/ok/core.php on line 3
Fatal error: require_once(): Failed opening required '/home/orgdevelopers.tk/public_html/ok/app/Config/constant.php' (include_path='.:/usr/local/lsws/lsphp70/share/pear:/usr/local/lsws/lsphp70/share/php:/usr/share/pear:/usr/share/php') in /home/orgdevelopers.tk/public_html/ok/core.php on line 3}
core.php line 3 is== require_once('app/Config/constant.php');
解决方案
如果两个文件都驻留在同一个目录中,则函数 inconstant.php
的路径应该是or或代替require_once
core.php
constant.php
/api/app/Config/constant.php
__DIR__.'/constant.php'
app/Config/constant.php
推荐阅读
- java - 如何在 Java 中将 Scala 回调函数设置为参数?
- spring-boot - 如何在 JUnit 测试中正确模拟 FeignClient 响应
- javascript - 如何使用旋转值通过变换或数学旋转 SVG 矩形?
- rxjs - Observable 在发出数据时是否必须完成?
- php - Composer 使用本地 Git 捆绑包,就像使用 Git 存储库一样
- java - 乔达日期时间的杰克逊 MismatchedInputException
- django - 如果用户已选择,则将复选框设置为禁用
- c# - ASP.NET:.NET Framework/Standard/Core DLL 冲突,由 Nuget 引起。“您必须添加对程序集 System.Runtime 的引用...”
- javascript - 允许两种标题内容类型 - Javascript反应axios
- mongodb - MongoDB为一个字段创建指向不同集合中另一个字段的指针