How to make FPDF work with CentOS 7

General support questions
Post Reply
adchico
Posts: 1
Joined: 2018/06/14 07:53:01

How to make FPDF work with CentOS 7

Post by adchico » 2018/06/14 08:10:10

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!

gjaltemba
Posts: 34
Joined: 2016/11/29 15:23:25

Re: How to make FPDF work with CentOS 7

Post by gjaltemba » 2018/06/14 14:07:29

What is the output of

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

User avatar
TrevorH
Forum Moderator
Posts: 23021
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to make FPDF work with CentOS 7

Post by TrevorH » 2018/06/14 14:22:48

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?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

gjaltemba
Posts: 34
Joined: 2016/11/29 15:23:25

Re: How to make FPDF work with CentOS 7

Post by gjaltemba » 2018/06/14 17:55:30

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();
?>

User avatar
TrevorH
Forum Moderator
Posts: 23021
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to make FPDF work with CentOS 7

Post by TrevorH » 2018/06/14 21:43:53

You need an XAMPP forum. You're not running the CentOS suppllied http/php stack. Nothing we supply installs anything under /opt/lampp.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply