Andri
Andri

Reputation: 461

Max execution time when including other files

I have a php file, a.php, that includes b.php, that includes c.php.

So a.php looks like this:

<?php 
include_once('b.php'); 
// code
?>

and b.php looks like this:

<?php
include_once('c.php');
// code 
?>

When I run a.php I get this error:

Fatal error: Maximum execution time of 60 seconds exceeded in c.php

When I get this error I usually use:

ini_set('max_execution_time', 5000);

and the problem goes away.

I tried to put it in a.php and c.php but I still get the error.

First question is: Does it matter whether I put it in a.php or c.php? Second question: If setting max_execution_time in a.php and c.php does not work, what do I do?

Btw. I can't access php.ini so I can't just set it there. Note: Obviously this isn't my actual code and filenames, but this is pretty much the setup. I am using someone else's code. So b.php and c.php were created by someone else and I am creating a.php.

Upvotes: 1

Views: 99

Answers (0)

Related Questions