【发布时间】:2009-12-05 21:37:03
【问题描述】:
我为下面的代码获得了 http500,我不知道出了什么问题。我是 php 新手。我检查了 PDF.php 是否在正确的目录中,字体也是如此
<?php
define('FPDF_FONTPATH','/home/php/File/PDF/fonts/');
require('/home/php/File/PDF.php');
$pdf=new FPDF('P', 'mm', array(100,150));
$pdf->AddPage();
$pdf->SetFont('times');
$pdf->Cell(40,10,'Hello World!');
$pdf->Output("ruchit.pdf", D);
?>
【问题讨论】:
-
我应该怎么做才能以正确的格式发布代码
-
500 错误大多不是由 PHP 代码引起的,它是服务器错误代码。您应该检查 Web 服务器的错误日志文件以获取详细信息。
-
使用php.net/manual/en/function.error-reporting.php 开启错误报告,以便在脚本运行时看到它们。