简体   繁体   English

我怎么能解决这些新的php-pdf字体错误?

[英]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. 今天,我们的Web服务器在使用php-pdf生成pdf时开始抛出这些错误。 Path is wrong but the pdf still generates. 路径错误但pdf仍然生成。 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 警告:fopen(/tmp/cachedTimes-Roman.php)[function.fopen]:无法打开流:2039行/home/site/public_html/include/pdf-php/src/Cpdf.php中的权限被拒绝

Warning: fwrite() expects parameter 1 to be resource, boolean given in /home/site/public_html/include/pdf-php/src/Cpdf.php on line 2040 警告:fwrite()期望参数1是资源,在2040行的/home/site/public_html/include/pdf-php/src/Cpdf.php中给出布尔值

Warning: fclose() expects parameter 1 to be resource, boolean given in /home/site/public_html/include/pdf-php/src/Cpdf.php on line 2041 警告:fclose()期望参数1是资源,在2041行的/home/site/public_html/include/pdf-php/src/Cpdf.php中给出布尔值

Most likely the device where /tmp is may have run out of space, so that new files can not be created there. 很可能/tmp所在的设备可能已用完空间,因此无法在那里创建新文件。

df -h in console should get you started. 在控制台中使用df -h可以帮助您入门。

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. 如果您是系统管理员,即使rm -rf /tmp/*可能会有所帮助,但如果当前正在使用的任何文件存储在那里,也可能会产生影响。

The warnings were caused by the script not being able to find the font files. 警告是由脚本无法找到字体文件引起的。 The problem was solved by explicitly setting the tempPath. 通过显式设置tempPath解决了这个问题。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM