S
S
szubcu2014-07-18 11:39:23
PHP
szubcu, 2014-07-18 11:39:23

How to interrupt the execution of a PHP script (function)?

I have a script for connecting to a mailbox using the imap protocol.
Moreover, if something happens to the mailer and it does not give a response, then the imap_open function (and, accordingly, the entire script) is suspended for a very very long time.
I tried to limit the script execution time through PHP settings (max_execution_time) and locally in a file (set_time_limit). Nothing helps.
In this regard, the question is - is it possible to interrupt the process of opening an imap box? Or somehow limit the execution time of a PHP script in some other way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2014-07-18
@szubcu

set a smaller timeout id1.php.net/manual/en/function.imap-timeout.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question