Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

UmaWorld's avatar

Maximum execution time of 60 seconds exceeded - while downloading pdf

#ProposalPdf.php

class ProposalPdf extends Component
{
    public $listeners = ['downloadProposalPdf'=> 'downloadProposalPdf'];
    public function downloadProposalPdf($proposalId)
{
    ini_set('max_execution_time', 120); 
      //Log::info('Listener Triggered', $proposalId); 
    $data = Proposal::find($proposalId); // Use $proposal->id to find the proposal
    
    //dd($data['overseas_conditions']);
    //dd($data);

    if (!$data) {
        abort(404); // Handle if proposal not found
    }

    $pdf = PDF::loadView('livewire.proposal-pdf', ['data' => $data]);
    //log:info($pdf);

    return $pdf->download('Agile Courts - Proposal');// Stream the PDF to the browser
}```
is this correct way to doing toset max execution time 
 ini_set('max_execution_time', 120);
0 likes
4 replies
UmaWorld's avatar

Symfony\Component\ErrorHandler\Error\FatalError: Maximum execution time of 120 seconds exceeded in file D:\xampp\htdocs\tennis_court1\vendor\dompdf\dompdf\src\Helpers.php on line 578

#0 {main}

Snapey's avatar

120 IS the max execution time, as your error shows. However if you change it to 200 I think it will still fail, but the error will be max execution time of 200 seconds exceeded.

Please or to participate in this conversation.