Topic on Extension talk:Mpdf

Mpdf/MpdfAction.php: Class 'mPDF' not found

6
145.253.133.129 (talkcontribs)

Error from line 97 of /var/www/wiki/extensions/Mpdf/MpdfAction.php: Class 'mPDF' not found


Fixed by inserting this line at the begin of the file:

require_once 'mpdf/mpdf.php';

Yaron Koren (talkcontribs)

How did you install the mPDF library?

Bjsdaiyu (talkcontribs)

I've had this same issue on a new install for MW 1.35. I followed the 1) download main Mpdf code -> `$IP/extensions/Mpdf` 2) download the mpdf source -> `$IP/extensions/Mpdf/mpdf` 3) enable the Mpdf extension in LocalSettings install path. Adding the line OP suggested to MpdfAction.php fixed it for me as well.

Seb35 (talkcontribs)

When you download from Extension Distributor it should work out-of-the-box, but when you download it from Git (or Github → Download ZIP) you have to execute Composer inside the directory Mpdf.

2001:14BA:2BF5:C300:4591:4354:337A:6ED5 (talkcontribs)

@Seb35

I can't get working from Github Mpdf REL1_36 and mpdf 8.0.10 in my MediaWiki 1.35.2 and PHP 7.4.16.

And when I use Extension Distributor, it can download a new Mpdf-version but mpdf is old. And old mpdf does not work with PHP 7.4. So how to get latest stable Mpdf + mPDF v8.0.10 package?

What do you mean "execute Composer inside the directory Mpdf"?

Thanks!

2001:14BA:2BF5:C300:988B:8262:6E5E:2327 (talkcontribs)

Update to previous message.

I downloaded mediawiki-extensions-Mpdf REL1_36 from Github, extracted it to an empty /extensions/Mpdf -directory, executed 'composer require mpdf/mpdf' inside the directory. Still, /extensions/Mpdf/MpdfAction.php: Class 'mPDF' not found

Any idea?

Reply to "Mpdf/MpdfAction.php: Class 'mPDF' not found"