Instalace mPDF na PHP 7.4 skrze composer

Rndoom04
Člen | 75
+
0
-

Dobrý den všem přeji. :)

Snažím se nainstalovat mPDF skrze composer composer require mpdf/mpdf, ale bez úspěchu.

Terminál mi hlásí:

Using version ^8.0 for mpdf/mpdf
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mpdf/mpdf v8.0.5 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - mpdf/mpdf v8.0.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
    - mpdf/mpdf v8.0.3 requires php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.2) does not satisfy that requirement.
    - mpdf/mpdf v8.0.2 requires php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.2) does not satisfy that requirement.
    - mpdf/mpdf v8.0.1 requires php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.2) does not satisfy that requirement.
    - mpdf/mpdf v8.0.0 requires php ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 -> your PHP version (7.4.2) does not satisfy that requirement.
    - Installation request for mpdf/mpdf ^8.0 -> satisfiable by mpdf/mpdf[v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.0.5].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.4/cli/php.ini
    - /etc/php/7.4/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.4/cli/conf.d/10-opcache.ini
    - /etc/php/7.4/cli/conf.d/10-pdo.ini
    - /etc/php/7.4/cli/conf.d/15-xml.ini
    - /etc/php/7.4/cli/conf.d/20-apcu.ini
    - /etc/php/7.4/cli/conf.d/20-calendar.ini
    - /etc/php/7.4/cli/conf.d/20-ctype.ini
    - /etc/php/7.4/cli/conf.d/20-curl.ini
    - /etc/php/7.4/cli/conf.d/20-dom.ini
    - /etc/php/7.4/cli/conf.d/20-exif.ini
    - /etc/php/7.4/cli/conf.d/20-ffi.ini
    - /etc/php/7.4/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.4/cli/conf.d/20-ftp.ini
    - /etc/php/7.4/cli/conf.d/20-gd.ini
    - /etc/php/7.4/cli/conf.d/20-gettext.ini
    - /etc/php/7.4/cli/conf.d/20-iconv.ini
    - /etc/php/7.4/cli/conf.d/20-igbinary.ini
    - /etc/php/7.4/cli/conf.d/20-imagick.ini
    - /etc/php/7.4/cli/conf.d/20-intl.ini
    - /etc/php/7.4/cli/conf.d/20-json.ini
    - /etc/php/7.4/cli/conf.d/20-memcache.ini
    - /etc/php/7.4/cli/conf.d/20-msgpack.ini
    - /etc/php/7.4/cli/conf.d/20-mysqli.ini
    - /etc/php/7.4/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.4/cli/conf.d/20-phar.ini
    - /etc/php/7.4/cli/conf.d/20-posix.ini
    - /etc/php/7.4/cli/conf.d/20-readline.ini
    - /etc/php/7.4/cli/conf.d/20-shmop.ini
    - /etc/php/7.4/cli/conf.d/20-simplexml.ini
    - /etc/php/7.4/cli/conf.d/20-sockets.ini
    - /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.4/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.4/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.4/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.4/cli/conf.d/20-xdebug.ini
    - /etc/php/7.4/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
    - /etc/php/7.4/cli/conf.d/20-xsl.ini
    - /etc/php/7.4/cli/conf.d/25-apcu_bc.ini
    - /etc/php/7.4/cli/conf.d/25-memcached.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

A po zadání php –ini mi vylezl tento report:

Configuration File (php.ini) Path: /etc/php/7.4/cli
Loaded Configuration File:         /etc/php/7.4/cli/php.ini
Scan for additional .ini files in: /etc/php/7.4/cli/conf.d
Additional .ini files parsed:      /etc/php/7.4/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.4/cli/conf.d/10-opcache.ini,
/etc/php/7.4/cli/conf.d/10-pdo.ini,
/etc/php/7.4/cli/conf.d/15-xml.ini,
/etc/php/7.4/cli/conf.d/20-apcu.ini,
/etc/php/7.4/cli/conf.d/20-calendar.ini,
/etc/php/7.4/cli/conf.d/20-ctype.ini,
/etc/php/7.4/cli/conf.d/20-curl.ini,
/etc/php/7.4/cli/conf.d/20-dom.ini,
/etc/php/7.4/cli/conf.d/20-exif.ini,
/etc/php/7.4/cli/conf.d/20-ffi.ini,
/etc/php/7.4/cli/conf.d/20-fileinfo.ini,
/etc/php/7.4/cli/conf.d/20-ftp.ini,
/etc/php/7.4/cli/conf.d/20-gd.ini,
/etc/php/7.4/cli/conf.d/20-gettext.ini,
/etc/php/7.4/cli/conf.d/20-iconv.ini,
/etc/php/7.4/cli/conf.d/20-igbinary.ini,
/etc/php/7.4/cli/conf.d/20-imagick.ini,
/etc/php/7.4/cli/conf.d/20-intl.ini,
/etc/php/7.4/cli/conf.d/20-json.ini,
/etc/php/7.4/cli/conf.d/20-mbstring.ini,
/etc/php/7.4/cli/conf.d/20-memcache.ini,
/etc/php/7.4/cli/conf.d/20-msgpack.ini,
/etc/php/7.4/cli/conf.d/20-mysqli.ini,
/etc/php/7.4/cli/conf.d/20-pdo_mysql.ini,
/etc/php/7.4/cli/conf.d/20-phar.ini,
/etc/php/7.4/cli/conf.d/20-posix.ini,
/etc/php/7.4/cli/conf.d/20-readline.ini,
/etc/php/7.4/cli/conf.d/20-shmop.ini,
/etc/php/7.4/cli/conf.d/20-simplexml.ini,
/etc/php/7.4/cli/conf.d/20-sockets.ini,
/etc/php/7.4/cli/conf.d/20-sysvmsg.ini,
/etc/php/7.4/cli/conf.d/20-sysvsem.ini,
/etc/php/7.4/cli/conf.d/20-sysvshm.ini,
/etc/php/7.4/cli/conf.d/20-tokenizer.ini,
/etc/php/7.4/cli/conf.d/20-xdebug.ini,
/etc/php/7.4/cli/conf.d/20-xmlreader.ini,
/etc/php/7.4/cli/conf.d/20-xmlwriter.ini,
/etc/php/7.4/cli/conf.d/20-xsl.ini,
/etc/php/7.4/cli/conf.d/20-zip.ini,
/etc/php/7.4/cli/conf.d/25-apcu_bc.ini,
/etc/php/7.4/cli/conf.d/25-memcached.ini

Jak můžeme vidět, chyba je v tom, že „the requested PHP extension mbstring is missing from your system“, ale v nainstalován je.

Nevíte někdo, kde by mohla být chybička a proč mi to nejde? :) Popřípadě pokud je mPDF špatné, co mi doporučíte na generování PDF souboru (mám v plánu udělat fakturační systém do e-shopu). :)

Děkuji všem za pomoc. :)

Editoval Rndoom04 (11. 2. 2020 16:22)

kocourPB
Člen | 47
+
0
-

Ahoj,

skus restartovat apache/nginx server a potom skus composer require mpdf/mpdf znova.

Pripadne, co ti vypise php -m ? Alebo este si vytvor prazdny php subor a daj do neho len:

<?php

phpinfo();

skus ho otvorit a uvidis, ci mas naloadovany mbstring.

Editoval kocourPB (11. 2. 2020 16:29)

Rndoom04
Člen | 75
+
0
-

kocourPB napsal(a):

Ahoj,

skus restartovat apache/nginx server a potom skus composer require mpdf/mpdf znova.

Pripadne, co ti vypise php -m ? Alebo este si vytvor prazdny php subor a daj do neho len:

<?php

phpinfo();

skus ho otvorit a uvidis, ci mas naloadovany mbstring.

Ahoj,

díky za odpověď. :) apache server jsem několikrát restartoval. :) I celý server (pro jistotu). :)

php -m vypíše:

[PHP Modules]
apc
apcu
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imagick
imap
intl
json
libxml
mbstring
mcrypt
memcache
memcached
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
readline
recode
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

phpinfo(); vypíše mimo jiné:

PHP Version 7.4.2
Additional .ini files parsed 	/etc/php/7.4/cgi/conf.d/10-mysqlnd.ini, /etc/php/7.4/cgi/conf.d/10-opcache.ini, /etc/php/7.4/cgi/conf.d/10-pdo.ini, /etc/php/7.4/cgi/conf.d/15-xml.ini, /etc/php/7.4/cgi/conf.d/20-apcu.ini, /etc/php/7.4/cgi/conf.d/20-calendar.ini, /etc/php/7.4/cgi/conf.d/20-ctype.ini, /etc/php/7.4/cgi/conf.d/20-curl.ini, /etc/php/7.4/cgi/conf.d/20-dom.ini, /etc/php/7.4/cgi/conf.d/20-exif.ini, /etc/php/7.4/cgi/conf.d/20-ffi.ini, /etc/php/7.4/cgi/conf.d/20-fileinfo.ini, /etc/php/7.4/cgi/conf.d/20-ftp.ini, /etc/php/7.4/cgi/conf.d/20-gd.ini, /etc/php/7.4/cgi/conf.d/20-gettext.ini, /etc/php/7.4/cgi/conf.d/20-iconv.ini, /etc/php/7.4/cgi/conf.d/20-igbinary.ini, /etc/php/7.4/cgi/conf.d/20-imagick.ini, /etc/php/7.4/cgi/conf.d/20-intl.ini, /etc/php/7.4/cgi/conf.d/20-json.ini, /etc/php/7.4/cgi/conf.d/20-mbstring.ini, /etc/php/7.4/cgi/conf.d/20-memcache.ini, /etc/php/7.4/cgi/conf.d/20-msgpack.ini, /etc/php/7.4/cgi/conf.d/20-mysqli.ini, /etc/php/7.4/cgi/conf.d/20-pdo_mysql.ini, /etc/php/7.4/cgi/conf.d/20-phar.ini, /etc/php/7.4/cgi/conf.d/20-posix.ini, /etc/php/7.4/cgi/conf.d/20-readline.ini, /etc/php/7.4/cgi/conf.d/20-shmop.ini, /etc/php/7.4/cgi/conf.d/20-simplexml.ini, /etc/php/7.4/cgi/conf.d/20-sockets.ini, /etc/php/7.4/cgi/conf.d/20-sysvmsg.ini, /etc/php/7.4/cgi/conf.d/20-sysvsem.ini, /etc/php/7.4/cgi/conf.d/20-sysvshm.ini, /etc/php/7.4/cgi/conf.d/20-tokenizer.ini, /etc/php/7.4/cgi/conf.d/20-xdebug.ini, /etc/php/7.4/cgi/conf.d/20-xmlreader.ini, /etc/php/7.4/cgi/conf.d/20-xmlwriter.ini, /etc/php/7.4/cgi/conf.d/20-xsl.ini, /etc/php/7.4/cgi/conf.d/20-zip.ini, /etc/php/7.4/cgi/conf.d/25-apcu_bc.ini, /etc/php/7.4/cgi/conf.d/25-memcached.ini

Tedy vypadá, že naloadované je… :)

EDIT: Vyřešeno a nevím jak. Prostě to začalo fungovat. :D

Editoval Rndoom04 (11. 2. 2020 21:42)