# Avoid Php script timeout

**URL:** <https://forum.getkirby.com/t/avoid-php-script-timeout/6304>\
**Category:** Questions\
**Tags:** v2\
**Created:** [January 16, 2017, 6:17pm UTC](https://forum.getkirby.com/t/avoid-php-script-timeout/6304 "2017-01-16T18:17:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [January 16, 2017, 6:17pm UTC](https://forum.getkirby.com/t/avoid-php-script-timeout/6304/1 "2017-01-16T18:17:02Z")

</div>

i have a task for kirby to perform. crunshing a lot of page objects (and i mean like 20k) and update each of them. yes. using kirby like a database is not the best idea but it worked well for now. since i need to store some files as well and be able to adjust the db-structure (blueprints in my case) easily.

obviously there is a php timeout after a while. i would like to just `refresh` my update skript after like 25 sek ([toolkit time](https://getkirby.com/docs/toolkit/api#timer)r) and continue. i can do this using html header and setting some params to track offset in my dataset.

```
echo "<meta http-equiv=\"refresh\" content=\"1\">\n";

```

i was wondering if calling the `go()` helper does the same? or is that kind of redirection still considered within the same execution timeframe. example

```
go($page->url().'/offset:'.$offset);

```

any other ideas how to do this properly with kirby?

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [January 16, 2017, 6:55pm UTC](https://forum.getkirby.com/t/avoid-php-script-timeout/6304/2 "2017-01-16T18:55:11Z")

</div>

What about this:

```php
set_time_limit(0);

```

Please note that you should only ever use this line right before stuff that takes long. Just setting it to 0 (= disable the timeout) in general is not a good idea.

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [January 17, 2017, 2:09pm UTC](https://forum.getkirby.com/t/avoid-php-script-timeout/6304/3 "2017-01-17T14:09:19Z")

</div>

did try that too, but maybe i did it wrong or maybe host simply does not allow it?  
php `safe_mode` is OFF so it should work in theory.

lets say i would end up with 15 min execution time, some time spend in waiting for post request and file io. how would you solve something like that?

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [January 17, 2017, 2:17pm UTC](https://forum.getkirby.com/t/avoid-php-script-timeout/6304/4 "2017-01-17T14:17:34Z")

</div>

It probably makes sense to run such a huge process from the command line instead. 15 minutes is way too long for most web servers, they will timeout even if PHP does not have a max execution time set.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:53pm UTC](https://forum.getkirby.com/t/avoid-php-script-timeout/6304/5 "2025-02-06T16:53:01Z")

</div>

Archived on February 6, 2025, 4:53pm UTC


