Understood the error "FPDF error: Unexpected end of stream", the FPDF class is in the /FPDF/fpdf.php folder, but if I connect it like this - require('/FPDF/fpdf.php'); , then gives an error PHP

 Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '../FPDF/fpdf.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u552896297/public_html/createPdfFromBase64.php on line 20 

Tell me how to properly connect the file, which lies in another folder?

I tried to connect in this way -

 require($_SERVER['DOCUMENT_ROOT'] .'/FPDF/fpdf.php'); 

But after that, Vornings and Fatal Arrorom (((

 Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/FPDF/fpdf.php) is not within the allowed path(s): (/home/:/usr/lib/php:/tmp:/usr/share/locale) in /home/u552896297/public_html/createPdfFromBase64.php on line 20 Warning: require(/usr/local/apache/htdocs/FPDF/fpdf.php) [function.require]: failed to open stream: Operation not permitted in /home/u552896297/public_html/createPdfFromBase64.php on line 20 Fatal error: require() [function.require]: Failed opening required '/usr/local/apache/htdocs/FPDF/fpdf.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/u552896297/public_html/createPdfFromBase64.php on line 20 
  • one
    Sorry, I already deleted my answer. He was a little off topic. What you do with require is the task of the absolute path. - zenith
  • one
    Ltd. I found a new bug at the forum :) The answer was deleted, but the respect remained O_o - zenith

1 answer 1

The topic can be closed, I figured out what was happening, the configuration of PHP (php.ini) on this hosting is not active open_basedir , so there were problems!