Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在带有vps nginx的DOMPF codeigniter中找不到图像_Codeigniter_Nginx_Dompdf - Fatal编程技术网

在带有vps nginx的DOMPF codeigniter中找不到图像

在带有vps nginx的DOMPF codeigniter中找不到图像,codeigniter,nginx,dompdf,Codeigniter,Nginx,Dompdf,我的应用程序使用codeigniter构建,并使用dompdf查看pdf。当我在vps nginx中运行我的应用程序时,问题是在使用dompdf查看pdf时找不到图像 注: 如果我使用html查看并使用内部链接在nginx中更改应用程序中的url图像,则会显示图像 如果我使用dompdf查看pdf,并使用外部链接在nginx的应用程序中更改url图像,则会显示图像 如果我的应用程序在localhost或hosting cpanel中运行,则不会出现问题,图像会显示出来 请帮帮我,谢谢 我的图

我的应用程序使用codeigniter构建,并使用dompdf查看pdf。当我在vps nginx中运行我的应用程序时,问题是在使用dompdf查看pdf时找不到图像

注:

  • 如果我使用html查看并使用内部链接在nginx中更改应用程序中的url图像,则会显示图像
  • 如果我使用dompdf查看pdf,并使用外部链接在nginx的应用程序中更改url图像,则会显示图像
  • 如果我的应用程序在localhost或hosting cpanel中运行,则不会出现问题,图像会显示出来
请帮帮我,谢谢

我的图书馆

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Pdfgenerator {

  public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "potrait")
  {
    $dompdf = new Dompdf();
    $dompdf->loadHtml($html);
    $dompdf->set_option('isRemoteEnabled', TRUE);
    $dompdf->setPaper($paper, $orientation);
    $dompdf->render();
    if ($stream) {
        $dompdf->stream($filename.".pdf", array("Attachment" => 0));
    } else {
        return $dompdf->output();
    }
  }
}