I've been trying to set up this php pdf script. I downloaded the code from the website and uploaded it as is from this page [https://sourceforge.net/projects/tcpdf/files/][1]
It works until the line that starts $pdf - I added echo $filename line to see if I could see errors (an idea found on this website - the page displays 1hello - I gather this probably means the require_once works OK.
<?
// Include the main TCPDF library (search for installation path).
$filename = require_once('../tcpdf/examples/tcpdf_include.php');
echo $filename.'hello';
exit;
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, true);
etc. etc.
If I remove $filename = and the echo / exit line (below) I get a generic server 500 error - any ideas how to get a detailed error I can actually use? I can see detailed errors on other pages.
<?
// Include the main TCPDF library (search for installation path).
require_once('../tcpdf/examples/tcpdf_include.php');
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false, true);
etc. etc.
EDIT: Found the error by adding ini_set('display_errors', 1); to the page - the error is Fatal error: Class 'TCPDF' not found...on line 31
Line 31 refers to:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
If I look in the tcpdf_include.php include file it says some code that refers to some files I don't think my server has:
$tcpdf_include_dirs = array(
realpath('../tcpdf.php'),
'/usr/share/php/tcpdf/tcpdf.php',
'/usr/share/tcpdf/tcpdf.php',
'/usr/share/php-tcpdf/tcpdf.php',
'/var/www/tcpdf/tcpdf.php',
'/var/www/html/tcpdf/tcpdf.php',
'/usr/local/apache2/htdocs/tcpdf/tcpdf.php' );
/usr/share/php/ is empty. I'm guessing I should put the tcpdf.php file in all of those locations or does it not matter & I'm missing the point?