2012-01-04 12 views
0

.pdfファイルを作成するためにPHPコードを使用していますが、その.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'); 
} 

} 

(その完了していないコード)

正確な問題とは何ですか?

+2

エラー/出力/警告/メッセージは、どのようなものですか? – Arfeen

+0

ftpはサーバーではなく、ファイルを転送するためのプロトコルです –

+0

サーバー上でエラーログと報告が有効になっていることを確認してください(php.iniの設定を確認してください)。何がうまくいかなかったかを教えてください。 – hakre

答えて

0

このコードがlocalhostで動作している場合は、おそらくサーバー上の権限の問題です。

0

Apacheのエラーログを確認してください。何らかのエラーがここに表示されます - あなたは、サーバー、タイプ

tail -f /var/log/apache/error.log 

にログインし、ページをリロードしている場合には、通常、/var/log/apache/error.log

に位置しています。

0

権限の問題のようです。 pdfファイルが作成されると予想されるディレクトリに対するアクセス許可を設定します。

関連する問題