duancai7002 2014-12-02 05:53
浏览 21

FPDF无法连接

I keep getting this error in a simple php to pdf file

Warning: require(fpdf17/fpdf.php): failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/tuto1.php on line 3

Fatal error: require(): Failed opening required 'fpdf17/fpdf.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/tuto1.php on line 3

I keep using the following paths:

define('FPDF_FONTPATH','fpdf17/font/'); require('fpdf17/fpdf.php');

OR

define('FPDF_FONTPATH','/Applications/XAMPP/xamppfiles/htdocs/fpdf17/font/'); require('/Applications/XAMPP/xamppfiles/htdocs/fpdf17/fpdf.php');

I moved the fpdf folder there from the desktop to make it easier since the path from the desktop doen't seem to work either.

Do I need to do something else? It just says on the internet that I just need to path it right. The path seems right, so what's wrong then?

EDIT:

FILE DIRECTORY:

  • Application

    • XAMPP

      • htdocs

        • tuto1.php

        • fpdf17

          • fpdf.php

          • font

tuto1.php code

<?php
define('FPDF_FONTPATH','fpdf17/font/');
require('fpdf17/fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?