Dompdf在本地工作但不在线

I have problems with dompdf, it works perfectly on localhost, but absolutely not online :

The pdf isn't generated but is displayed on the browser : my code :

<?php ob_start();?>
//My code

<?php $html = ob_get_clean();

require_once 'dompdf/autoload.inc.php';
?>
<?php

// reference the Dompdf namespace

use Dompdf\Dompdf;

// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml($html);

 // (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'portrait');

// Render the HTML as PDF
$dompdf->render();

// Output the generated PDF to Browser
$dompdf->stream(); ?>


Votre paiement a bien été pris en compte. 

<?php 

$output = $dompdf->output();
file_put_contents("factures/".$nbr.".pdf", $output);

 ?>