问题描述
我在PHP中找到了一些PDF文件基因对程序. 当我团聚时,我会收到以下错误
警告:require(/Include/fpdf153/fpdf.php)[function.require]:失败 打开流:没有此类文件或目录 C:\ XAMPP \ htdocs \ aks \ mikepdf.php on Line 57
致命错误:require()[function.Require]:所需的打开失败 '/include/fpdf153/fpdf.php'(include_path ='.; c:\ xampp \ php \ pear \')in C:\ XAMPP \ htdocs \ aks \ mikepdf.php on Line 57
我认为fpdf.php丢失了.我已经在他们的网站上搜索了,但找不到英文版本.
任何人都可以为我提供英语版本的完整链接吗?
推荐答案
当前PHP正在寻找C:\include\fpdf153\fpdf.php中的文件,因为它是绝对路径.
尝试将文件放入C:\xampp\htdocs\aks\include\fpdf153\中并使用follwing语句:
需要(include/fpdf153/fpdf.php);
然后,它根据您的当前工作使用相对链接(我想是C:\xampp\htdocs\aks\).它应该起作用.
您可以找到更多信息 php手册 > > > p>
其他推荐答案
我认为您与require函数一起使用的文件路径是错误的
其他推荐答案
i假定根文件夹的名称为 test .
/test
将字体文件夹和fpdf.php复制到/test
示例, 将sample.php创建到/测试文件夹中.
<?php require('fpdf.php'); $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); ?>
问题描述
i have found some pdf file geneartion program in php. When i reun it i get the following error
Warning: require(/include/fpdf153/fpdf.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\aks\mikepdf.php on line 57
Fatal error: require() [function.require]: Failed opening required '/include/fpdf153/fpdf.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\aks\mikepdf.php on line 57
I think the fpdf.php is missing. I have searched on their site but i could not find the english version.
can anyone provide me full link of english version?
推荐答案
Currently PHP is looking for the file in C:\include\fpdf153\fpdf.php as it is an absolute path.
Try to put the file in C:\xampp\htdocs\aks\include\fpdf153\ and use the follwing statement:
require(include/fpdf153/fpdf.php);
Then it uses a relative link based on your current working this (I guess it's C:\xampp\htdocs\aks\). And it should work.
You can find more info in the PHP manual
其他推荐答案
I think that the file path that you have used with the require function is wrong
其他推荐答案
I presume that the name of root folder is a test.
/test
copy font folder and fpdf.php into /test
Example, Create sample.php into /test folder.
<?php require('fpdf.php'); $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); ?>