【问题标题】:Error custom helper laravel 5.2, autoload files error错误自定义助手 laravel 5.2,自动加载文件错误
【发布时间】:2017-01-11 23:00:05
【问题描述】:

我已经创建了自定义助手 laravel 5.2。我放入文件夹 App/Helpers/Global.php。

并在 composer.json 中自动加载文件:

"autoload": { 
   "files" : [
       "App/Helpers/Global.php"
   ]
}

在我的 Windows PC 上,它工作正常,但是当我部署到 VPS centos 时,我收到了这个错误。

PHP Warning:  require(/xxxx/xxxxx/public_html/xxxx/vendor/composer/../../App/Helpers/Global.php): failed to open stream: No such file or directory in /xxxx/xxxx/public_html/xxxx/vendor/composer/autoload_real.php on line 66

为什么自动加载“文件”是相对于供应商目录的? 提前致谢。

error custom helper

【问题讨论】:

    标签: php laravel


    【解决方案1】:

    您的 VPS 上的操作系统似乎具有与 Windows 不同的区分大小写的文件名文件系统。 只需将 "App/Helpers/Global.php" 替换为 "app/Helpers/Global.php" 即可。

    【讨论】:

    • It Works Andrej,感谢您的帮助。
    猜你喜欢
    • 2017-11-09
    • 1970-01-01
    • 2017-01-02
    • 2016-05-28
    • 2017-01-20
    • 2017-02-02
    • 2012-08-08
    • 2014-05-21
    • 2017-02-26
    相关资源
    最近更新 更多