Using FPDF with webhost

I have another problem with a portion of my code that doesn’t want to work on the host while it works perfectly on my PC and I’m hoping someone will be able to help me.

These reports are extracted monthly and are numbered accordingly - e.g. Report 23 of 60
Followed by the Month & Year

I managed to come up with this bit of code that does the job on my PC but creates a server error on the webhost:

$last_month_last_day=strtotime('last day of last month');
$no_of_days=date('t',$last_month_last_day);
$date_value=$last_month_last_day;
$d1 = new DateTime("2014-08-31");
$d2 = new DateTime();
$d3 = $d1->diff($d2);
$month = ($d3->y*12)+$d3->m;
$months = ($month-1);
$date = date("F Y",$date_value);

$pdf->SetX(48);
$pdf->SetFont('Arial','B',14);
$pdf->Cell(118,6,'Report No. '.$months.' of 60',0,0,'L',0);
$pdf->Cell(83,6,$date,0,1,'R',0);
$pdf->SetFont('Arial','B','14');
$pdf->SetX(65);

Can anyone see what’s causing this error, please?