In my local vagrant environment pdf generation takes only about 2 seconds:
We also have a development server which has similar results:
However on the production server it takes over 40 secs.
All servers use Ubuntu 14.04 and Apache 2.4.7. The only difference seems to be that the production server is behind a load balancer.
This is the setup I am using:
public function pdf(){
$title = $this->input->post('export_title', TRUE);
$data['title'] = preg_replace('/_/', ' ', $title);
$templateID = $this->input->post('export_template_id', TRUE);
$answerID = $this->input->post('export_answer_id', TRUE);
$data['form'] = $this->getAnsweredForm($templateID, $answerID);
$html = $this->load->view('pdf/header', '', true);
$html .= $this->load->view('pdf/view_custom_form', $data, true);
$pdf = new mikehaertl\wkhtmlto\Pdf(array(
// Explicitly tell wkhtmltopdf that we're using an X environment
'use-xserver',
// Enable built in Xvfb support in the command
'commandOptions' => array(
'enableXvfb' => true,
)));
$pdf->addPage($html);
if(!$pdf->send("$title.pdf")){
echo $pdf->getError();
}
}
I've also tried just passing in 'google.com' with similar results. We use CodeIgniter and I tried passing in the URI of a page which resulted in it being generated appropriately on my vagrant but 'Failure without error message' on the production server.
Any debugging tips would be greatly appreciated. I've looked and haven't found anyone with similar issues, so I was hoping you could help here.
In my local vagrant environment pdf generation takes only about 2 seconds:
We also have a development server which has similar results:
However on the production server it takes over 40 secs.
All servers use Ubuntu 14.04 and Apache 2.4.7. The only difference seems to be that the production server is behind a load balancer.
This is the setup I am using:
I've also tried just passing in 'google.com' with similar results. We use CodeIgniter and I tried passing in the URI of a page which resulted in it being generated appropriately on my vagrant but 'Failure without error message' on the production server.
Any debugging tips would be greatly appreciated. I've looked and haven't found anyone with similar issues, so I was hoping you could help here.