我正在使用PHP代碼創建.pdf文件,並且我在該.pdf文件中歸檔表單值。用於創建.pdf文件的php代碼在服務器上不起作用
在本地主機上的代碼工作正常,它創建.pdf,編輯.pdf文件.... 但是當我把相同的代碼放在另一臺服務器上時,它不會創建.pdf並編輯爲......
代碼是 -
<?php
date_default_timezone_set('UTC');
require('fpdf/fpdf.php');
class PDF_result extends FPDF {
function __construct ($orientation = 'P', $unit = 'pt', $format = 'Letter', $margin = 5) {
$this->FPDF($orientation, $unit, $format);
$this->SetTopMargin($margin);
$this->SetLeftMargin($margin);
$this->SetRightMargin($margin);
//$this->SetRightMargin1($margin1);
$this->SetAutoPageBreak(true, $margin);
}
function Header() {
//$this->SetLeftMargin(85);
$this->SetLeftMargin(5);
$this->Image('header3.jpg',25,15,560);
$this->SetLeftMargin(25);
// $this->SetFont('Arial', 'B', 20);
// $this->SetFillColor(36, 96, 84);
// $this->SetTextColor(225);
// $this->Cell(0, 30, "YouHack MCQ Results", 0, 1, 'C', true);
}
function Footer()
{
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Page number
$this->Cell(0,10,'ifs , india',0,0,'C');
}
function Generate_Table($subjects, $marks) {
$this->SetFont('Arial', 'B', 12);
$this->SetTextColor(0);
// $this->SetFillColor(94, 188, z);
$this->SetFillColor(94, 188, 225);
$this->SetLineWidth(1);
$this->Cell(427, 25, "Subjects", 'LTR', 0, 'C', true);
$this->Cell(100, 25, "Marks", 'LTR', 1, 'C', true);
$this->SetFont('Arial', '');
$this->SetFillColor(238);
$this->SetLineWidth(0.2);
$fill = false;
for ($i = 0; $i < count($subjects); $i++) {
$this->Cell(427, 20, $subjects[$i], 1, 0, 'L', $fill);
$this->Cell(100, 20, $marks[$i], 1, 1, 'R', $fill);
$fill = !$fill;
}
$this->SetX(367);
//$this->Cell(100, 20, "Total", 1);
// $this->Cell(100, 20, array_sum($marks), 1, 1, 'R');
}
}
(它不是完整的代碼)
什麼是確切的問題?
你得到了什麼確切的錯誤/輸出/警告/消息? – Arfeen 2012-01-04 09:33:03
ftp不是服務器,它是用於傳輸文件的協議 – 2012-01-04 09:33:26
注意您的服務器上啓用了錯誤日誌記錄和報告(檢查您的php.ini配置),然後查看錯誤日誌。它應該告訴你哪裏出了問題。 – hakre 2012-01-04 09:33:45