Mike Volmar
Mike Volmar

Reputation: 2093

how can I troubleshoot these new php-pdf font errors?

Today our web server started throwing these errors when generating a pdf with php-pdf. Path is wrong but the pdf still generates. Unsure why this path issue started or how to fix it. Also concerned that it just started seemingly on its own.

Warning: fopen(/tmp/cachedTimes-Roman.php) [function.fopen]: failed to open stream: Permission denied in /home/site/public_html/include/pdf-php/src/Cpdf.php on line 2039

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/site/public_html/include/pdf-php/src/Cpdf.php on line 2040

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/site/public_html/include/pdf-php/src/Cpdf.php on line 2041

Upvotes: 1

Views: 240

Answers (2)

Mike Volmar
Mike Volmar

Reputation: 2093

The warnings were caused by the script not being able to find the font files. The problem was solved by explicitly setting the tempPath.

$pdf->tempPath = '../include/pdf-php/src/fonts';

Upvotes: 0

Thor Juhasz
Thor Juhasz

Reputation: 57

Most likely the device where /tmp is may have run out of space, so that new files can not be created there.

df -h in console should get you started.

If you are the system administrator, even rm -rf /tmp/* might help, but may also have consequences if any files currently in use are stored there.

Upvotes: 0

Related Questions