Paheko + DomPDF = LogicException - You need to install the PHP GD extension to be able to use this extension

What app is this about, and its version: 1.3.17.1~ynh1
What YunoHost version are you running: 12.1.37
What type of hardware are you using: VPS bought online

Describe your issue

:united_kingdom: Hello,

I just installed Paheko 1.3.17.1~ynh1 on my server. When I try to activate the DomPDF module, I get the following error message (details at the bottom of the post) :

An error has occurred - LogicException - You need to install the PHP GD extension to be able to use this extension.

Thank you in advance,

C.


:france: Bonjour,

Je viens d’installer Paheko 1.3.17.1~ynh1 sur mon serveur. Lorsque j’essaie d’activer le module DomPDF je me retrouve avec le message d’erreur suivant (détails en bas du post) :

Une erreur s’est produite - LogicException - You need to install the PHP GD extension to be able to use this extension.

En vous remerciant par avance,

C.

Share relevant logs or error messages

Une erreur s’est produite

LogicException

You need to install the PHP GD extension to be able to use this extension.

in …/data/plugins/dompdf/lib/PDF.php:28

24
25	static public function install(): void
26	{
27		if (!function_exists('imagecreatefromwebp')) {
28			throw new \LogicException('You need to install the PHP GD extension to be able to use this extension.');
29		}
30
31		// Remove old setup, new one is shared between setups
32		if (file_exists(CACHE_ROOT . '/dompdf')) {

in …/data/plugins/dompdf/install.php:8

→ Paheko\Plugin\Dompdf\PDF::install (0 arg.)

4
5use Paheko\Plugin\Dompdf\PDF;
6
7// Download and unzip DomPDF library
8PDF::install();
9
10$plugin->registerSignal('pdf.stream', 'Paheko\Plugin\Dompdf\PDF::stream');
11$plugin->registerSignal('pdf.create', 'Paheko\Plugin\Dompdf\PDF::create');
12

in …/include/lib/Paheko/Entities/Plugin.php:468

→ include (1 arg.)

0
string(35) ".../data/plugins/dompdf/install.php"
464			}
465
466			$plugin = $this;
467
468			include $path;
469		}
470		else {
471			Plugins::routeStatic($this->name, $file);
472		}

in …/include/lib/Paheko/Entities/Plugin.php:538

→ Paheko\Entities\Plugin->call (2 arg.)

$file
string(11) "install.php"
$allow_protected
bool(true)
534		$this->set('enabled', true);
535		$this->save();
536
537		if (!$exists && $this->hasFile(self::INSTALL_FILE)) {
538			$this->call(self::INSTALL_FILE, true);
539		}
540
541		$db->commit();
542	}

in …/include/lib/Paheko/Entities/Extension.php:67

→ Paheko\Entities\Plugin->enable (0 arg.)

63	}
64
65	public function enable()
66	{
67		$this->{$this->type}->enable();
68	}
69
70	public function disable()
71	{

in …/www/admin/config/ext/details.php:24

→ Paheko\Entities\Extension->enable (0 arg.)

20	throw new UserException($ext->broken_message);
21}
22
23$form->runIf('enable', function () use ($ext) {
24	$ext->enable();
25}, $csrf_key, $ext->details_url);
26
27$form->runIf('disable', function () use ($ext) {
28	$ext->disable();

→ Paheko\{closure} (0 arg.)

in …/include/lib/Paheko/Form.php:29

→ call_user_func (1 arg.)

$callback
object(Closure)#154 (1) {
  [0]=> *RECURSION*
  }
25			if (null !== $csrf_key && !\KD2\Form::tokenCheck($csrf_key)) {
26				throw new ValidationException('Une erreur est survenue, merci de bien vouloir renvoyer le formulaire.', 401);
27			}
28
29			call_user_func($fn);
30
31			if (null !== $redirect) {
32				if ($js) {
33					http_response_code(204);

in …/include/lib/Paheko/Form.php:80

→ Paheko\Form->run (4 arg.)

$fn
object(Closure)#154 (1) {
  [0]=> *RECURSION*
  }
$csrf_key
string(10) "ext_dompdf"
$redirect
string(68) "https://adh.sud-culture.org/admin/config/ext/details.php?name=dompdf"
$follow_redirect
bool(false)
76		elseif (is_bool($condition) && !$condition) {
77			return null;
78		}
79
80		return $this->run($fn, $csrf_key, $redirect, $follow_redirect);
81	}
82
83	public function hasErrors()
84	{

in …/www/admin/config/ext/details.php:23

→ Paheko\Form->runIf (4 arg.)

$condition
string(6) "enable"
$fn
object(Closure)#154 (1) {
  [0]=> *RECURSION*
  }
$csrf_key
string(10) "ext_dompdf"
$redirect
string(68) "https://adh.sud-culture.org/admin/config/ext/details.php?name=dompdf"
19if ($ext->broken_message) {
20	throw new UserException($ext->broken_message);
21}
22
23$form->runIf('enable', function () use ($ext) {
24	$ext->enable();
25}, $csrf_key, $ext->details_url);
26
27$form->runIf('disable', function () use ($ext) {

Log in via ssh and install the missing dep:

sudo apt install php8.3-gd

We can add it to package deps, to be released soon ™

1 Like

Ok, whe add this php, but there is yet mupdf-tools innstalled and so mupdf

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.