混合清单不存在-在Hostgator共享主机中部署Laravel时,Laravel Fortify Jetstream登录/注册问题 [英] The Mix manifest does not exist - Laravel Fortify Jetstream Login/Registration Issue when deploying laravel in Hostgator shared hosting

查看:0
本文介绍了混合清单不存在-在Hostgator共享主机中部署Laravel时,Laravel Fortify Jetstream登录/注册问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我过去已经能够成功地部署Laravel项目。 这是我第一次在Jetstream和Livewire上使用Laravel 8。Laravel现在正在使用Fortify进行登录和注册身份验证。

我的本地服务器工作正常,没有问题。将项目部署到Hostgator共享主机帐户后,我的主页正确加载,并正确读取和输出我的数据库中的数据。

但是,当我尝试访问

mydomain.com/登录/或mydomain.com/登录 或 Mydomain.com/Register/或mydomain.com/Register

我收到一个500错误。在下面这个问题的结尾处,我粘贴了错误日志。

我做了以下工作:

  1. 已更新Composer版本
  2. NPM重建
  3. NPM安装
  4. 我都试过了:NPM运行dev,NPM运行生产,并重新上传每个场景中的所有内容。
  5. 我已将公共/index.php路径指向正确的应用程序文件夹,以读取autoload.php和bootstrap/app.php文件。
  6. 我已将所有文件夹和子文件夹chmod至755,将所有文件chmod至644
我觉得很奇怪,我的主页加载得无懈可击,而且从数据库中获取数据也很好,因此我知道我的.env文件具有正确的数据库连接凭据。只有登录和注册会引发500错误。

我的环境文件:

APP_NAME=NameOfApp
APP_ENV=production
APP_KEY=base64:KeyGeneratedWhenProjectCreated
APP_DEBUG=false
APP_URL=http://domain
LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=db_works_good
DB_USERNAME=username_works_good
DB_PASSWORD=passwordWorksGood

以下是laravel.log(缩写为重要的内容):

[2020-11-30 20:25:34] production.ERROR: The Mix manifest does not exist. (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) {"exception":"[object] (ErrorException(code: 0): The Mix manifest does not exist. (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) (View: /domain_root_path/app/resources/views/layouts/guest.blade.php) at /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php:46)
[stacktrace]
#0 /domain_root_path/app/vendor/livewire/livewire/src/CompilerEngine.php(38): Illuminate\View\Engines\CompilerEngine->handleViewException(Object(ErrorException), 0)
#1 /domain_root_path/app/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(60): Livewire\CompilerEngine->handleViewException(Object(ErrorException), 0)
#2 /domain_root_path/app/vendor/livewire/livewire/src/LivewireViewCompilerEngine.php(32): Illuminate\View\Engines\PhpEngine->evaluatePath('/home2/usr2...', Array)
...................
#52 /domain_root_path/public_html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#53 {main}
[previous exception] [object] (Exception(code: 0): The Mix manifest does not exist. at /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Foundation/Mix.php:46)
[stacktrace]




#0 /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(506): Illuminate\Foundation\Mix->__invoke('/css/app.css')
#1 /domain_root_path/app/storage/framework/views/f25b68bee7f180a7da8624828693071be98325dc.php(14): mix('css/app.css')
#2 /domain_root_path/app/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(107): require('/home2/usr2...')
............................................
#66 {main}

文件结构:

根目录有两个文件夹:

  • 应用程序(包含除公用文件夹以外的所有文件)
  • public_html:包含包括index.php在内的所有公共内容

我的index.php(在公共内部)有以下路径:

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

$app = require_once __DIR__.'/../app/bootstrap/app.php';
GUEST.BLADE.PHP如下所示: (请注意,此文件是由Laravel自动生成的,我没有碰过它)

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>{{ config('app.name', 'Laravel') }}</title>

        <!-- Fonts -->
        <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap">

        <!-- Styles -->
        <link rel="stylesheet" href="{{ mix('css/app.css') }}">

        <!-- Scripts -->
        <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.7.3/dist/alpine.js" defer></script>
    </head>
    <body>
        <div class="font-sans text-gray-900 antialiased">
            {{ $slot }}
        </div>
    </body>
</html>

/Public/Mix-言辞.json:

{
    "/js/app.js": "/js/app.js",
    "/css/app.css": "/css/app.css"
}

推荐答案

我替换了 <link rel="stylesheet" href="{{ mix('css/app.css') }}">

<link rel="stylesheet" href="/css/app.css/">

现在可以使用了。

这篇关于混合清单不存在-在Hostgator共享主机中部署Laravel时,Laravel Fortify Jetstream登录/注册问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆