我目前正在尝试在 Vagrant/Homestead 上运行一个从 Github 拉取的 Laravel 应用程序。我将其连接到数据库,并在文件夹内运行 Composer Install、Composer Update。当我尝试在浏览器上访问它时,出现以下错误:
警告:require(/home/vagrant/.../public/vendor/autoload.php):无法打开流:在线/home/vagrant/..../public/autoload.php中没有这样的文件或目录2
我导航到供应商文件夹,发现它尚未创建。有什么想法如何修复它吗?
该应用程序在 Laravel 4 中运行,当我运行 Composer Install 时,我从终端得到以下输出:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package herrera-io/json is abandoned, you should avoid using it. Use kherge/json instead.
Package kherge/version is abandoned, you should avoid using it. No replacement was suggested.
Package herrera-io/phar-update is abandoned, you should avoid using it. No replacement was suggested.
Package mjolnic/bootstrap-colorpicker is abandoned, you should avoid using it. Use itsjavi/bootstrap-colorpicker instead.
生成自动加载文件
php artisan 清晰编译
php artisan 优化
生成优化的类加载器
有任何想法吗?
Composer 需要从应用程序的根目录运行,即不是从public
文件夹,如您的错误所示。
您可以先尝试运行:
composer install --no-scripts
此命令应列出正在下载和安装的软件包。如果上述有效,您可以运行:
php artisan optimize
这将创建 Laravel 将使用的 autoload.php 文件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)