Php 如何有效地解决open_basedir限制错误

Php 如何有效地解决open_basedir限制错误,php,wordpress,Php,Wordpress,我正在尝试使用fpdf创建一个pdf,但是当我在本地主机上运行它时,我没有遇到任何问题 但是,当我在WorpAddress服务器上运行时,我会遇到以下错误: Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/home/a1302477/public_html/wp-content/plugins/roque/fpdf/font/unifont/DejaVuSansCondensed.ttf)

我正在尝试使用
fpdf
创建一个pdf,但是当我在本地主机上运行它时,我没有遇到任何问题

但是,当我在WorpAddress服务器上运行时,我会遇到以下错误:

Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/home/a1302477/public_html/wp-content/plugins/roque/fpdf/font/unifont/DejaVuSansCondensed.ttf) is not within the allowed path(s): (/home/u541784927:/tmp:/var/tmp:/opt/php-5.3/pear) in /home/u541784927/public_html/wp-content/plugins/roque/fpdf/font/unifont/ttfonts.php on line 496

Warning: fopen(/home/a1302477/public_html/wp-content/plugins/roque/fpdf/font/unifont/DejaVuSansCondensed.ttf) [function.fopen]: failed to open stream: Operation not permitted in /home/u541784927/public_html/wp-content/plugins/roque/fpdf/font/unifont/ttfonts.php on line 496
Can't open file /home/a1302477/public_html/wp-content/plugins/roque/fpdf/font/unifont/DejaVuSansCondensed.ttf
我怎样才能解决这个问题,请帮忙

要创建pdf,我正在使用代码

require('fpdf/tfpdf.php');

    echo $quix = $_POST['quizzz'];

    $pdf = new tFPDF();

    $questions = $_POST['question'];

    $count = count($questions);

    $quests = "";

    $pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);

    $pdf->SetFont('DejaVu','',14);

    $pdf->SetFont('times','',12);

    $pdf->SetTextColor(50,60,100);



    $pdf->AddPage('P');

    //$pdf->SetDisplayMode(real,'default');



    $pdf->SetFontSize(12);



    for($i=1;$i<=$count;$i++)

    {

        $qus_id = $questions[$i-1];

        $get_q = "select * from `SelleXam_question` where `id`='$qus_id'";

        $get_q =  $wpdb->get_results($get_q);

        $questf = "Quest $i : ".$get_q[0]->question;

                $pdf->Cell(0, 10, iconv('UTF-8', 'ISO-8859-2', $questf)."\n");                              if($get_q[0]->image !=='')      {           $pdf->Ln();         $path = plugins_url();          $imagenurl = $path.'/roque/uploads/'.$get_q[0]->image;                      $pdf->Cell(0, 10, $pdf->Image($imagenurl,$pdf->GetX()+60, $pdf->GetY() + 5,50,50), 0, 0, 'L','');       }

        $questf = "Option 1 : ".$get_q[0]->op1;

        $pdf->Ln();

        $pdf->Cell(0, 10, $questf."\n");

        $questf = "Option 2 : ".$get_q[0]->op2;

        $pdf->Ln();

        $pdf->Cell(0, 10, $questf."\n");

        $questf = "Option 3 : ".$get_q[0]->op3;

        $pdf->Ln();

        $pdf->Cell(0, 10, $questf."\n");

        $questf = "Option 4 : ".$get_q[0]->op4;

        $pdf->Ln();

        $pdf->Cell(0, 10, $questf."\n");

        $pdf->Ln();

        $pdf->Ln();
require('fpdf/tfpdf.php');
echo$quix=$_POST['quizzz'];
$pdf=新的tFPDF();
$questions=$_POST['question'];
$count=count($problems);
$quests=“”;
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
$pdf->SetFont('times','',12);
$pdf->SetTextColor(50,60100);
$pdf->AddPage('P');
//$pdf->SetDisplayMode(实数,'default');
$pdf->SetFontSize(12);
对于($i=1;$iget\u结果($get\u q);
$questf=“Quest$i:”.$get_q[0]->问题;
$pdf->Cell(0,10,iconv('UTF-8','ISO-8859-2',$questf)。“\n”);if($get_q[0]->image!=''{$pdf->Ln();$path=plugins_url();$imagenurl=$path./roque/uploads/'.$get_q[0]->image;$pdf->Cell(0,10,$pdf->image->image($imagenurl,$pdf->GetX()+60,$pdf()+GetY()+5,50,50),0,0,'L','';}
$questf=“选项1:”.$get_q[0]->op1;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$questf=“选项2:”.$get_q[0]->op2;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$questf=“选项3:”.$get_q[0]->op3;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$questf=“选项4:”.$get_q[0]->op4;
$pdf->Ln();
$pdf->Cell(0,10,$questf.“\n”);
$pdf->Ln();
$pdf->Ln();

看起来,您正在混合来自不同服务器的路径。请在第496行显示您的代码(或将路径传递给fpdf类的位置)我没有制作任何硬编码路径,那么我如何混合它们:我没有制作任何硬编码路径,那么我如何混合它们:为什么文件位于
/home/u541784927
中,并在
/home/a302477
中请求另一个?