WordPress.org

Forums

[resolved] maximum execution time of 30 seconds exceeded (8 posts)

  1. totzkie
    Member
    Posted 3 years ago #

    Hi Everyone,

    Im currrently developing a plugin and currently encounter a problem maximum execution time of 30 seconds exceeded.... during my program execution. I searched on how to fix it and found solutions which says that I need to put set_time_limit(0) in the config.php or in the .htaccess insert php_value max_execution_time 60, but I want it to be included in my plugin.
    Is there anybody knows how to programmatically insert those line of code I've mentioned above.

    Thanks in advance...

  2. Ming Sheu
    Member
    Posted 3 years ago #

    Here's the info on php docs, http://php.net/manual/en/function.set-time-limit.php

    Are you developing the plugin for yourself or for distribution? 30 seconds is a lot of time so unless there's some specific application/plugin with limited distribution, it is generally a bad idea to extend the time out even further.

    Do you really need more than 30 seconds?

  3. totzkie
    Member
    Posted 3 years ago #

    actually, the project I am doing is for our school sake. And the plugin need more than 30 seconds to process. So that, I need to include in my plugin to automatically set the time limit before starting process.

    Could you help me how to do this or just give me a hint? I really need to done this as soon as possible. Thanks...

  4. Pioneer Valley Web Design
    Member
    Posted 3 years ago #

    if your host allows, create a php5.ini file with the proper settings...commonly, on basic hosting this is not allowed. Review with your webhost.

  5. totzkie
    Member
    Posted 3 years ago #

    oh I see, I never thought that it is not allowed on basic hosting. So it depends on the webhost .
    Thanks for the reply.

  6. Ming Sheu
    Member
    Posted 3 years ago #

    Did you read the doc and test by adding set_time_limit() to your plugin code?

  7. totzkie
    Member
    Posted 3 years ago #

    what do you mean by testing adding set_time_limit() to my plugin code? Is that mean I will just add set_time_limit() somewhere in my plugin code? But yes, I have read the documentation on how to fix the problem but it states that I should insert set_time_limit() in the config.php file of wordpress. Unfortunately, I don't know how to implement that process with the use of my plugin.

  8. totzkie
    Member
    Posted 3 years ago #

    Hi Ming Sheu, I would like to say thank you very much. Finally, It works, I just insert set_time_limit() into my plugin process section, and no need to configure the config.php. I didn't encounter the error anymore.
    Thank you very much again and more power.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.