首页 > 解决方案 > 警告: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');

标签: phpcakephp

解决方案


如果两个文件都驻留在同一个目录中,则函数 inconstant.php的路径应该是or或代替require_oncecore.phpconstant.php/api/app/Config/constant.php__DIR__.'/constant.php'app/Config/constant.php


推荐阅读