尝试在 Laravel 中读取 barryvh/dompdf 时无法解析公共路径

Gre*_*ker 2 css php pdf laravel laravel-8

我将 Laravel 应用程序部署到共享托管。然后,我将文件夹分为两个 DOMAIN(包含所有其他文件夹)和 public_html(包含公共目录中的文件)。然后我像这样公开修改了index.php文件

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

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once __DIR__.'/../domain/bootstrap/app.php';
Run Code Online (Sandbox Code Playgroud)

该应用程序似乎运行良好,除了一些功能(例如 barrydompdf),它给我错误“无法解析公共路径”请知道如何解决此问题。谢谢大家。

小智 19

这是 DOMPDF 最愚蠢的错误。要解决这个错误,你需要做的就是在项目目录下创建一个public文件夹,虽然没有什么用。