尝试设置 Laravel 4 给出“无法打开流:没有这样的文件或目录”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16810425/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 02:27:34  来源:igfitidea点击:

Trying to set up Laravel 4 gives "failed to open stream: No such file or directory"

laravellaravel-4

提问by user2431832

Trying to set up Laravel 4 on a Mac. I've installed Composer but when I go to the public folder via XAMPP I get this:

尝试在 Mac 上设置 Laravel 4。我已经安装了 Composer,但是当我通过 XAMPP 进入公共文件夹时,我得到了这个:

Warning: require(/Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/autoload.php on line 17

Fatal error: require() [function.require]: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/autoload.php on line 17

警告:需要(/Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/../vendor/autoload.php)[function.require]:无法打开流:/Applications/XAMPP/中没有这样的文件或目录xamppfiles/htdocs/laravel-master/bootstrap/autoload.php 第 17 行

致命错误:require() [function.require]:无法打开所需的 '/Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/XAMPP /xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') 在 /Applications/XAMPP/xamppfiles/htdocs/laravel-master/bootstrap/autoload.php 第 17 行

采纳答案by Rick

Okay,

好的,

I had the same problem and found a way to fix it.

我遇到了同样的问题,并找到了解决方法。

Just read this: http://laravel.com/docs/installationand follow it.

只需阅读此内容:http: //laravel.com/docs/installation并遵循它。

Install composer first, add laravel to the root and install the composer.json with cmd. It worked for me.

先安装composer,将laravel添加到root,用cmd安装composer.json。它对我有用。

回答by adib.mosharrof

You need to provide the following command from your terminal

您需要从终端提供以下命令

composer install

作曲家安装

it might get stuck due to permission issues, so try with

由于权限问题,它可能会卡住,所以请尝试

sudo composer install

须藤作曲家安装

I guess this should solve your problem.

我想这应该可以解决您的问题。

回答by Steve Bals

in the command prompt try this

在命令提示符下试试这个

D:\xampp\htdocs\laravel>composer update 

回答by Mashpy Rahman

Suppose your laravel site directory is /srv/example.com/

假设你的 Laravel 站点目录是 /srv/example.com/

and your VPS username is "ubuntu". So write this command

你的 VPS 用户名是“ubuntu”。所以写这个命令

sudo chown -R ubuntu.www-data /srv/example.com/

Most of the time hosting username is "www-data". That time you can write this

大多数时候托管用户名是“www-data”。到时候你可以写这个

sudo chown -R www-data.www-data /srv/example.com/

回答by hserusv

laravel need 5.3.7. please check your php version . if its below from mentioned then its will produce like this error Server Requirement

Laravel 需要 5.3.7。请检查您的 php 版本。如果它在下面提到,那么它会产生这样的错误 Server Requirement