【问题标题】:file_exist() not working and stopping all code from being executed underneath it [closed]file_exist() 不工作并阻止所有代码在其下执行[关闭]
【发布时间】:2020-09-29 14:28:31
【问题描述】:

正如标题所说,我被难住了。我过去多次成功使用此功能,但现在突然之间它根本不起作用。它上面的一切都将正常显示,它下面的一切都消失了。给定的文件路径是正确的,因为 require 与同一个文件完美配合。

//this works
require $_SERVER['DOCUMENT_ROOT']."/custom/phsh/includes/login.php";

//this doesn't return anything it just stops the code right here
echo file_exist($_SERVER['DOCUMENT_ROOT']."/custom/phsh/includes/login.php");

【问题讨论】:

  • 可能是相对路径与绝对路径的问题。但是没有看到你的实际代码和文件层次结构,我们只是猜测。
  • 添加了一些代码
  • 如果下次遇到此类错误,请添加完整准确的错误信息

标签: php syntax-error file-exists


【解决方案1】:

这是一个拼写错误,我写了 file_exist();但它应该是 file_exists();

【讨论】:

    猜你喜欢
    • 2012-11-09
    • 2015-11-01
    • 1970-01-01
    • 2013-05-23
    • 1970-01-01
    • 2014-03-20
    • 1970-01-01
    • 2014-06-28
    • 1970-01-01
    相关资源
    最近更新 更多