我们在drupal 7中使用tcpdf生成pdf文件时遇到错误。
Notice: tempnam(): file created in the system's temporary directory in TCPDF_STATIC::getObjFilename() (line 296 of /var/www/html/sites/all/libraries/tcpdf/include/tcpdf_static.php).
当我们注释以下代码时,此错误将消失
$path = 'sites/default/files/'.$user->mail.'/'.$sign_file;
$tcpdf->Image($path,145, 102.75, 40, 15, $sign_filetype , '', '', true, 150, '', false, false, 1, false, false, false);
此文件的文件权限为
-rw-rw---- 1 apache apache 5917 Mar 4 23:10 sign.png
版本详细信息为TCPDF模块-7.x-1.0-beta1和php 7.2.27。预先感谢您提供解决此问题的建议。
这可以通过在php.ini文件中添加temp目录的路径来解决。例如:
upload_tmp_dir = /tmp