简体   繁体   English

laravel 在实时服务器上找不到路由

[英]laravel route not found on live server

My laravel app work in localhost but when I try to deploy on Shared hosting without ssh my route app not work, just '/' URL is work but when I call any route it returns 'Not found' "the request URL/myappName/Middleware/routeName was not found on this server" My laravel app work in localhost but when I try to deploy on Shared hosting without ssh my route app not work, just '/' URL is work but when I call any route it returns 'Not found' "the request URL/myappName/Middleware在此服务器上找不到 /routeName"

and I moved public content to root folder and changed directory for "vendor and bootstrap"我将公共内容移动到根文件夹并更改了“供应商和引导程序”的目录

Kindly read through this:请仔细阅读:

  1. Make sure the Version of php on the shared hosting is higher or equal to the version of php your laravel is using.确保共享主机上的 php 版本高于或等于 laravel 正在使用的 php 版本。
  2. After uploading the files, got to the public folder and move all the files in it to the root directory.上传文件后,进入公共文件夹并将其中的所有文件移动到根目录。 then, go to index.php and find the following lines然后,go 到 index.php 并找到以下行
require __DIR__.'/../vendor/autoload.php';
and 
$app = require_once __DIR__.'/../bootstrap/app.php';

modify the by removing /.. from each so that they look like the lines below通过从每个中删除 /.. 来修改它们,使它们看起来像下面的行

require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';

Then check the url again.然后再次检查 url。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM