/    Sign up×
Community /Pin to ProfileBookmark

mpdf cann’t load on real host at $mpdf = new MpdfMpdf();

According to i upload my mpdf to my real host on internet and try to print pdf out but i got fail at code below:

I dont’t know why this code $mpdf = new MpdfMpdf(); cann’t work it’s print out only “01”

[code]echo “0”;
require_once __DIR__ . ‘/vendor/autoload.php’;
echo “1”;
$mpdf = new MpdfMpdf();
echo “2”;
$mpdf->WriteHTML(‘Hello World’);

$mpdf->Output(‘filename.pdf’);[/code]

__(Added `[code]…[/code]` tags ~ MOD)__

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NitiphoneauthorFeb 17.2021 — on my localhost can work correctly. it's PHP 7.4.9 but on web hosting PHP 5.6
Copy linkTweet thisAlerts:
@NogDogFeb 17.2021 — My guess is that it requires some PHP 7.x feature, but start by finding out what the error is. Either check the PHP log on the server, or add the following to the script before you get to that code:
<i>
</i>ini_set('display_errors', true); // set to false in production
error_reporting(E_ALL);
Copy linkTweet thisAlerts:
@NogDogFeb 17.2021 — PS: I'd suggest talking to your hosting provider and see if they have a PHP 7 option -- 5.x has been unsupported for a few years now, and 8 has just been released. (They skipped 6, by the way.)
Copy linkTweet thisAlerts:
@VITSUSAFeb 18.2021 — @Nitiphone#1628131 I agree with NogDog, once you should consult with your hosting provider and discuss the latest version which they are using.
×

Success!

Help @Nitiphone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...