laravel Laravel4 错误在第 17 行显示 /bootstrap/autoload.php

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21986230/
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-14 09:05:19  来源:igfitidea点击:

Laravel4 Error showing /bootstrap/autoload.php on line 17

laravel

提问by Stephen Tafler

I uploaded a new laravel 4 app and cannot figure out how to get it to work. I am not sure if it is something with the composer.json file or what. Here is the error I am getting:

我上传了一个新的 Laravel 4 应用程序,但不知道如何让它工作。我不确定它是否与 composer.json 文件或什么有关。这是我得到的错误:

>Warning: require(/home/flemzy/public_html/l/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory in /home/flemzy/public_html/l/bootstrap/autoload.php on line 17

>Fatal error: require() [function.require]: Failed opening required '/home/flemzy/public_html/l/bootstrap/../vendor/autoload.php' (include_path='.:/opt/php53/lib/php') in /home/flemzy/public_html/l/bootstrap/autoload.php on line 17

回答by Miroslav Trninic

Where did you upload you Laravel app ? From you path it seems it is in your home folder ? Laravel should be placed on your server, and you should point your server path to Laravel public folder. There is a default .htaccessfile in every Laravel instalation, which is ready for Apache. Also, after install, you should run composer install, in order to download all dependencies. That vendor/autoload.phpfile is a part of core framework, so that means that you didn't install all dependencies properly.

你在哪里上传你的 Laravel 应用程序?从您的路径来看,它似乎在您的主文件夹中?Laravel 应该放在您的服务器上,并且您应该将服务器路径指向 Laravel 公共文件夹。每个 Laravel 安装中都有一个默认的.htaccess文件,为 Apache 做好准备。此外,安装后,您应该运行composer install,以便下载所有依赖项。该vendor/autoload.php文件是核心框架的一部分,因此这意味着您没有正确安装所有依赖项。

回答by synapseradio

I have had similar messages / problems uploading laravel to a server subdirectory.

我在将 laravel 上传到服务器子目录时遇到了类似的消息/问题。

Laravel docs provide an alternate .htaccess file that fixed my problems.

Laravel 文档提供了一个替代的 .htaccess 文件来解决我的问题。

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Copy / paste that into your .htaccess, replacing the old one. Laravel Docs

将其复制/粘贴到您的 .htaccess 中,替换旧的。Laravel 文档

To use the command line if it's a composer issue, you can use SSH to access your laravel directory. If you're using windows you can use PuTTY for that, which has lots of tutorials and instructions online.

如果是 Composer 问题,要使用命令行,您可以使用 SSH 访问 Laravel 目录。如果您使用的是 Windows,您可以使用 PuTTY,它有很多在线教程和说明。

Laravel SSH docs

Laravel SSH 文档