请求的资源 / 未在此服务器上找到 PHP

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

The requested resource / was not found on this server PHP

phpserverlocalhost

提问by Thiago Souza

I ran the php server on cmd using php -S localhost:8080, like this:

我使用 cmd 在 cmd 上运行 php 服务器php -S localhost:8080,如下所示:

enter image description here

在此处输入图片说明

And I got this problem opening the localhost:

我在打开本地主机时遇到了这个问题:

enter image description here

在此处输入图片说明

What do I supposed to do?

我该怎么办?

回答by Thiago Souza

Missing index.phpin the root folder. Thank you all.

缺少index.php根文件夹。谢谢你们。

回答by Robert LUgo

This error also occurs when you have a path with the same name as a directory in the public folder:

当您的路径与公用文件夹中的目录同名时,也会发生此错误:

Definition of path in the file routes.php

文件routes.php中路径的定义

    Route::get('Glaciares',function(){
        return view('Principal.Glaciares.Acerca');
    });

Public folder

公用文件夹

enter image description here

在此处输入图片说明

回答by Udara Gunawardhana

Save the error blade file in another name and set the route in that name. eg:

以另一个名称保存错误刀片文件并以该名称设置路由。例如:

 index.blade.php save welcome.blade php

Route:

路线:

Route::get('/welcome', function () {
    return view('welcome');
});

回答by noe

in rails, Missing

在轨道上,失踪

def index

end 

in your controller.

在您的控制器中。

if not, restart your computer and everything is fine

如果没有,请重新启动计算机,一切正常