Laravel 索引页面和目录

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

Laravel index page and directories

phplaravel

提问by user3762188

I'm a beginner for laravel. And I have a problem about folder indexing.

我是 Laravel 的初学者。我有关于文件夹索引的问题。

When I paste all laravel files to localhost/l4 folder. Than I go to "localhost/l4" page and there's only folder indexes in my screen. Not "welcome" page.

当我将所有 Laravel 文件粘贴到 localhost/l4 文件夹时。然后我转到“localhost/l4”页面,屏幕上只有文件夹索引。不是“欢迎”页面。

image of indexes

索引图像

What should I do? When I paste files which are in public folder, to main folder. There's an other error as:

我该怎么办?当我将公共文件夹中的文件粘贴到主文件夹时。还有一个错误如下:

Warning: require(/home/movingto/public_html/or/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/movingto/public_html/or/bootstrap/autoload.php on line 17

Fatal error: require(): Failed opening required '/home/movingto/public_html/or/bootstrap/../vendor/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/movingto/public_html/or/bootstrap/autoload.php on line 17

警告:需要(/home/movingto/public_html/or/bootstrap/../vendor/autoload.php):无法打开流:/home/movingto/public_html/or/bootstrap/autoload.php中没有这样的文件或目录在第 17 行

致命错误:require(): 无法打开所需的 '/home/movingto/public_html/or/bootstrap/../vendor/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib /php') 在 /home/movingto/public_html/or/bootstrap/autoload.php 第 17 行

I need some help please. Just wanna get laravel folder.

我需要一些帮助。只想得到laravel文件夹。

回答by Mostafa Talebi

First you should go to localhost/14/publicto visit the welcome page.

首先你应该去localhost/14/public访问欢迎页面。

Second, if you apply changes to the folder places, you should as well update your bootstrap/paths.phpfile or index.phpto proper paths (index.phpis the basic loader of the bootstrap file and thus is superbly important)

其次,如果您对文件夹位置进行更改,您还应该更新您的bootstrap/paths.php文件或index.php正确的路径(index.php是引导文件的基本加载程序,因此非常重要)

What you can do to eliminate the ../public/..from your address when you upload your site?

../public/..上传网站时,您可以做些什么来消除地址中的 ?

Move all of Laravel's directories and files, except public directory, to the one directory behind the public_html, which is homedir/. Then, copy the content of the public folder right into the public_html(not the public folder, just the content), and delete the public folder. You now should tell laravel about the changes, so, go to index.phpand bootstrap/paths.php and change the path(s) to new one(s).

将所有Laravel的目录和文件,除了公共目录,到后面的一个目录public_html,这是homedir/。然后,将公用文件夹的内容复制到public_html(不是公用文件夹,只是内容)中,并删除公用文件夹。您现在应该告诉 laravel 更改,因此,转到index.phpbootstrap/paths.php 并将路径更改为新路径。