Page 1 of 1

How to make FPDF work with CentOS 7

Posted: 2018/06/14 08:10:10
by adchico
I used XAMPP on my local client and it works but when I uploaded it to my CentOS Web Server the reports fpdf pages returns blank pages. I didn't find anything on the web to answer this although I found same issues posted but there was no solution. I hope you can shed light to this issue. Thank you so much!

Re: How to make FPDF work with CentOS 7

Posted: 2018/06/14 14:07:29
by gjaltemba
What is the output of

yum list installed |grep -e php -e php-fpdf

Re: How to make FPDF work with CentOS 7

Posted: 2018/06/14 14:22:48
by TrevorH
The chances are that if you are using XAMPP then you probably aren't using CentOS supplied versions of anything involved in this. Can you post the output from rpm -qa httpd php\* mariadb\* please?

Re: How to make FPDF work with CentOS 7

Posted: 2018/06/14 17:55:30
by gjaltemba
I installed xampp-linux-x64-7.2.6-0-installer.run on CentOS Linux release 7.5.1804 (Core). Started Apache Web Server from xampp manager.

Put the following in /opt/lampp/htdocs and the test passed. Not sure what your problem is.

Code: Select all

<?php
require('fpdf.php');
$path = '/opt/lampp/lib/php/fonts';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

Re: How to make FPDF work with CentOS 7

Posted: 2018/06/14 21:43:53
by TrevorH
You need an XAMPP forum. You're not running the CentOS suppllied http/php stack. Nothing we supply installs anything under /opt/lampp.