Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot register_shutdown_function for max execution time #9769

Closed
Locustv2 opened this issue Sep 25, 2015 · 1 comment
Closed

Cannot register_shutdown_function for max execution time #9769

Locustv2 opened this issue Sep 25, 2015 · 1 comment

Comments

@Locustv2
Copy link

I have a controller action as follows:

public function actionTest()
{
    set_time_limit(1);
    register_shutdown_function(function()
    {
        var_dump('shutdown');
    });

    while(true){} //infinite loop
}

And i still get the fatal error "Maximum execution time of 1 second exceeded"

If i don't sleep or make the execution time to exceed, the shutdown function is called.
According to http://php.net/manual/en/function.register-shutdown-function.php#33575 and several examples from the internet, the shutdown should be called even if the execution time is exceeded.

How should i handle the execution time error?

@samdark
Copy link
Member

samdark commented Sep 25, 2015

Not related to Yii.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants