PDF Export problem, "An unknown error occurred" #645

Closed
opened 2026-02-04 21:34:21 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @martialEU on GitHub (Apr 16, 2018).

Hello, i need some help with my pdf export.

For Bug Reports

  • BookStack Version (Found in settings, Please don't put 'latest'): v0.20.3
  • PHP Version: 7.0
  • MySQL Version: Ver 15.1 Distrib 10.1.26-MariaDB
Current Behavior

Here what i have in my laravel.log :

production.ERROR: Class 'DomPDF' not found {"userId":1,"email":"martial@gmail.com","exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'DomPDF' not found at /var/www/bookstack/app/Services/ExportService.php:130)

I don't know what to do from now, I tried a lot of things :

  • Update bookstack
  • Update packets
  • Try some new configuration in my .env file etc.
Originally created by @martialEU on GitHub (Apr 16, 2018). Hello, i need some help with my pdf export. ### For Bug Reports * BookStack Version *(Found in settings, Please don't put 'latest')*: v0.20.3 * PHP Version: 7.0 * MySQL Version: Ver 15.1 Distrib 10.1.26-MariaDB ##### Current Behavior Here what i have in my laravel.log : `production.ERROR: Class 'DomPDF' not found {"userId":1,"email":"martial@gmail.com","exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'DomPDF' not found at /var/www/bookstack/app/Services/ExportService.php:130)` I don't know what to do from now, I tried a lot of things : * Update bookstack * Update packets * Try some new configuration in my .env file etc.
OVERLORD added the 🐕 Support label 2026-02-04 21:34:21 +03:00
Author
Owner

@Abijeet commented on GitHub (Apr 16, 2018):

Hi @martialEU,

I would recommend that you run the following commands,

composer install
php artisan cache:clear

My assumption is that DomPDF is not installed and the composer install command should fix it.

@Abijeet commented on GitHub (Apr 16, 2018): Hi @martialEU, I would recommend that you run the following commands, ``` composer install php artisan cache:clear ``` My assumption is that **DomPDF** is not installed and the `composer install` command should fix it.
Author
Owner

@martialEU commented on GitHub (Apr 17, 2018):

I already tried it, (didn't work). I don't understand why this class isn't found. Did i need to re-install BookStack ? Or can I drag and drop this .php file from someone else ?

> php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');"
> php -r "!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');"
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: intervention/image
Discovered Package: laravel/socialite
Discovered Package: fideloper/proxy
Discovered Package: barryvdh/laravel-dompdf
Discovered Package: barryvdh/laravel-snappy
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: socialiteproviders/manager
Package manifest generated successfully.
> php artisan cache:clear
Cache cleared successfully.
> php artisan view:clear
Compiled views cleared!

Still the same error :

[2018-04-17 07:25:20] production.ERROR: Class 'DomPDF' not found {"userId":1,"email":"admin@example.com","exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'DomPDF' not found at /var/www/bookstack/app/Services/ExportService.php:130)

I also have this in my config/app.php

         * Third Party
         */
        Barryvdh\DomPDF\ServiceProvider::class,

Thanks for you help.

@martialEU commented on GitHub (Apr 17, 2018): I already tried it, (didn't work). I don't understand why this class isn't found. Did i need to re-install BookStack ? Or can I drag and drop this .php file from someone else ? ``` > php -r "!file_exists('bootstrap/cache/services.php') || @unlink('bootstrap/cache/services.php');" > php -r "!file_exists('bootstrap/cache/compiled.php') || @unlink('bootstrap/cache/compiled.php');" Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating optimized autoload files > Illuminate\Foundation\ComposerScripts::postAutoloadDump > @php artisan package:discover Discovered Package: intervention/image Discovered Package: laravel/socialite Discovered Package: fideloper/proxy Discovered Package: barryvdh/laravel-dompdf Discovered Package: barryvdh/laravel-snappy Discovered Package: barryvdh/laravel-debugbar Discovered Package: barryvdh/laravel-ide-helper Discovered Package: socialiteproviders/manager Package manifest generated successfully. > php artisan cache:clear Cache cleared successfully. > php artisan view:clear Compiled views cleared! ``` Still the same error : `[2018-04-17 07:25:20] production.ERROR: Class 'DomPDF' not found {"userId":1,"email":"admin@example.com","exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'DomPDF' not found at /var/www/bookstack/app/Services/ExportService.php:130)` I also have this in my config/app.php ``` * Third Party */ Barryvdh\DomPDF\ServiceProvider::class, ``` Thanks for you help.
Author
Owner

@martialEU commented on GitHub (Apr 17, 2018):

Ok i just did

php artisan config:cache

Everything works fine after that. I don't why running this command fix this issue but now i can render .pdf

@martialEU commented on GitHub (Apr 17, 2018): Ok i just did `php artisan config:cache` Everything works fine after that. I don't why running this command fix this issue but now i can render .pdf
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#645