0
votes

I have an error fpdf A PHP Error was encountered Severity: Warning

Message: include_once(/home/u7639860/public_html/application/third_party/Fpdf/Pdf.php): failed to open stream: No such file or directory

Filename: libraries/Pdf.php

Line Number: 7

Backtrace:

File: /home/u7639860/public_html/application/libraries/Pdf.php Line: 7 Function: _error_handler

File: /home/u7639860/public_html/application/libraries/Pdf.php Line: 7 Function: include_once

File: /home/u7639860/public_html/application/controllers/Tb_permohonan.php Line: 15 Function: library

File: /home/u7639860/public_html/index.php Line: 316 Function: require_once

this my libraries

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

class Pdf {

    public function __construct() {

        include_once APPPATH.'third_party/Fpdf/Pdf.php';

        $pdf = new FPDF();
        $pdf->AddPage();

        $CI =& get_instance();
        $CI->Pdf = $pdf;

    }

}

?>

help me..

1

1 Answers

0
votes

it's very simple because you only need to call one of the libraries

$this->load->library('Pdf');

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

class Pdf {

    public function __construct() {

        // include_once APPPATH.'third_party/Fpdf/Pdf.php'; 

        $pdf = new FPDF();
        $pdf->AddPage();

        $CI =& get_instance();
        $CI->Pdf = $pdf;

    }

}

?>

Function include_once is deleted, it's run