Я пытался разместить свое приложение Laravel на веб-хосте. Были некоторые проблемы с этим, в конце концов мне удалось заставить его работать. CSS загружается, компоненты загружаются, все работает как надо, кроме функционала контроллеров. Я не могу войти / зарегистрироваться.
Я полностью следую этому руководству: https://www.youtube.com/watch?v=6g8G3YQtQt4
Шаги, которые я предпринял для его получения для работы, которая также обсуждается в видео, следующие:
- Архивирование всего проекта Laravel и его загрузка на FTP под субдоменом, чтобы папка была project.site_url.com- > laravel_project_directory.
- Распаковка zip-файла через файловый менеджер cpanel
Извлечены следующие файлы: файлы в каталоге проекта
- Я получил все из папки 'publi c' и поместил их в каталог поддомена, чтобы папка publi c исчезла, и я мог использовать ссылку сайта, не вставляя / publi c для отображения веб-сайта.
- Измените index. php на:
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/start.php';
- Изменено 'server. php' на:
'public' => __DIR__.'/..',
- Измените файл .htaccess на:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteBase /
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
После всего этого я вижу, что CSS загружается, но я не могу войти / зарегистрироваться. Это дает мне следующую ошибку: ошибка
{
"message": "",
"exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php",
"line": 43,
"trace": [
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php",
"line": 162,
"function": "handleMatchedRoute",
"class": "Illuminate\\Routing\\AbstractRouteCollection",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 635,
"function": "match",
"class": "Illuminate\\Routing\\RouteCollection",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 624,
"function": "findRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
"line": 613,
"function": "dispatchToRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 165,
"function": "dispatch",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 128,
"function": "Illuminate\\Foundation\\Http\\{closure}",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
"line": 21,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
"line": 27,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
"line": 63,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/fruitcake/laravel-cors/src/HandleCors.php",
"line": 36,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Fruitcake\\Cors\\HandleCors",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/fideloper/proxy/src/TrustProxies.php",
"line": 57,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 167,
"function": "handle",
"class": "Fideloper\\Proxy\\TrustProxies",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
"line": 103,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 140,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
"line": 109,
"function": "sendRequestThroughRouter",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "/home/n0load1q/docuSite.0loading.com/public/index.php",
"line": 55,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
}
]
}
Ошибка, которую я получаю в консоли: Ошибка консоли