Search code examples
phpubuntucomposer-phpfpdffpdi

Install FPDI on Ubuntu 16.04


I just ran apt-get install libfpdi-php as well as installed composer and ran composer require setasign/fpdi-fpdf. all three operations seemed to complete swimmingly well however is still get the error when calling require_once('fpdi.php'); in my PHP script (which is line 3, after calling require_once ('fpdf.php');:

PHP Warning: require_once(fpdi.php): failed to open stream: No such file or directory in /fpdfwriteon.php on line 3 PHP Fatal error: require_once(): Failed opening required 'fpdi.php' (include_path='.:/usr/share/php') in /fpdfwriteon.php on line 3

I've searched my entire disk for "fpdi" and nothing returns. Am I missing a step? Did I do something wrong with composer?

thanks.

EDIT: I have a link to fpdf.php in /usr/share/php/ from when I installed fpdf but there is no indication of fpdi anywhere


Solution

  • Refer this link : https://www.devmanuals.net/install/ubuntu/ubuntu-16-04-LTS-Xenial-Xerus/how-to-install-libfpdi-php.html

    You can verify the installation by running the following command.

    user@demo:/$ dpkg -L libfpdi-php
    /.
    /usr
    /usr/share
    /usr/share/php
    /usr/share/php/fpdi
    /usr/share/php/fpdi/fpdi.php
    /usr/share/php/fpdi/fpdi2tcpdf_bridge.php
    /usr/share/php/fpdi/fpdi_pdf_parser.php
    /usr/share/php/fpdi/pdf_context.php
    /usr/share/php/fpdi/pdf_parser.php
    /usr/share/php/fpdi/filters
    /usr/share/php/fpdi/filters/FilterASCII85.php
    /usr/share/php/fpdi/filters/FilterASCII85_FPDI.php
    /usr/share/php/fpdi/filters/FilterLZW.php
    /usr/share/php/fpdi/filters/FilterLZW_FPDI.php
    /usr/share/doc
    /usr/share/doc/libfpdi-php
    /usr/share/doc/libfpdi-php/copyright
    /usr/share/doc/libfpdi-php/changelog.Debian.gz
    

    When you calling fpdi.php, just give full path in include function.

    include('/usr/share/php/fpdf.php');
    include('/usr/share/php/fpdi/fpdi.php');