我想试用FPDF, XAMPP 它运行得很好,但是当我将它上传到我的网络服务器时,它说错误:
警告:include(/font/helveticab.php):无法打开流:/comeromers/9/f/c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php中没有此类文件或目录在1147行警告:include():打开失败' /font/helveticab.php'在第1147行的/customers/9/f/c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php中包含(include_path ='。:/ usr / share / php')致命错误:未捕获异常:FPDF错误:无法在/customers/9/f/c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php:275中包含字体定义文件堆栈跟踪:#0 / customers / 9 /f/c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php(1149):FPDF->错误('无法包括......')#1 / customers / 9 / f / c / dynamistic.de / httpd.www / websites / testauftrag / fpdf.php(463):FPDF-> _loadfont(' helveticab.php')#2 / customers / 9 / f /c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php(511):FPDF-> AddFont(' helvetica',' B')#3 / customers /9/f/c/dynamistic.de/httpd.www/websites/testauftrag/rechnung.php(14):FPDF-> SetFont(' helvetica',' B', 15)#4 /customers/9/f/c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php(338):PDF-> Header()#5 / customers / 9 / f / c / dynamistic.de/httpd.www/websites/testauftrag/ rechnung.php(65):FPDF-> AddPage()#6 {main}在第275行的/comersomers/9/f/c/dynamistic.de/httpd.www/websites/testauftrag/fpdf.php中抛出
这是导致错误的fpdf.php部分:
protected function _loadfont($font)
{
// Load a font definition file from the font directory
if(strpos($font,'/')!==false || strpos($font,"\\")!==false)
$this->Error('Incorrect font definition file name: '.$font);
include($this->fontpath.$font);
if(!isset($name))
$this->Error('Could not include font definition file');
if(isset($enc))
$enc = strtolower($enc);
if(!isset($subsetted))
$subsetted = false;
return get_defined_vars();
}