Forminator giving PHP fatal error

I am getting the below error from forminator on the logs,

PHP Fatal error: Maximum execution time of 300 seconds exceeded in /var/web/site/public_html/wp-content/plugins/forminator/library/class-export.php on line 723

How do I fix this?

  • Nithin Ramdas
    • Support Wizard

    Hi Daniel Herstedt ,

    Could we know if there are any specific steps to replicate the above-mentioned error? Do you notice this when performing any specific action in Forminator? Like Exporting or editing any specific settings?

    On further checking the staging, I’m afraid I’m not able to replicate any such error in the logs when Debug mode is enabled. I’m keeping the debug mode enabled in staging to see whether it could record any such errors.

    Please do let us know if there is anything missed with replicating the issue so that it would help us in giving a better idea. Looking forward to your response.

    Kind Regards,
    Nithin

  • Atom Agency
    • Site Builder, Child of Zeus

    Hello Nithin,

    Thank you!
    Yes, I see that no errors occur on the staging site, although it is a fresh copy of the prod site… But on the prod site the error keep coming:

    [30-Mar-2020 07:20:26 UTC] PHP Fatal error: Maximum execution time of 300 seconds exceeded in /var/web/site/public_html/wp-content/plugins/forminator/library/class-export.php on line 723

    Now, on the prod site we removed the Social Warfare plugin and replaced with Hustle, since Social Warefare was the only plugin we have added since we moved the site from our previous hosting, Upcloud.

    But the errors still keep coming on prod. I will reset the staging again now that we have done changes on prod. If no issues appear on staging, but still on prod, I’m lost…

    Thanks,
    Daniel

  • Ouissal Aouinti
    • Support-Woman

    Hello Daniel Herstedt !

    I hope you are doing well today!

    I have checked your site but still can’t replicate the issue on my end, however, the error that you are getting is triggered due to some process taking longer to complete and it is timing out.

    Since we can’t replicate the issue on your site there is a workaround that I need you to try it and see if you will get the error again, please login to your site files using SFTP/FTP and go to your root files ( /public_html/ ) search or wp-config file and add the following line of code:
    set_time_limit(600);
    The above line of code will increase your time out and prevent the time out errors that are taking less that 600s from showing.

    Please add the code above where it says,
    /* That's all, stop editing! Happy blogging. */

    I hope this helps, please don’t hesitate and leaving a reply if you need further help.

    Have a great day ahead!

    Kind regards,
    Ouissal

  • Atom Agency
    • Site Builder, Child of Zeus

    Seems like 600 also exceeded. But the site is running well.

    [31-Mar-2020 07:43:52 UTC] PHP Fatal error: Maximum execution time of 600 seconds exceeded in /var/web/site/public_html/wp-content/plugins/forminator/library/class-export.php on line 723

    Very strange that this error message only appears on the prod, when staging is a direct copy…

  • Ouissal Aouinti
    • Support-Woman

    Hello Daniel Herstedt !

    I hope you are doing well today!

    I have checked your site again and seems that the issue was still there, however, I further checked your site and I have increased/updated your PHP version from 7.3 to 7.4 and I waited for sometime and checked multiple times and seems that the issue is gone, at lease for now.

    Further more, I could see that the CPU of your site is always upper than 40% and this means that you always have requests, visitor etc… I suggest you to use CloudFlare to store your DNS records and enable Proxy so that not all your site access will be done on the server and can remove some server requests as well.

    However, please check the errors and if they came again please leave a comment so I can check this further.

    I hope this help, have a great day ahead!

    Kind regards,
    Ouissal

  • Ouissal Aouinti
    • Support-Woman

    Hello again Daniel Herstedt !

    I hope you are having a good day!

    I rechecked your site today and seems that the issue is still there.
    Your issue has been flagged for our SLS Team so that they can dig into it further for you. We will post an update here as soon as more information are available.

    Please keep in mind that our SLS Team deals with more complicated issues, so it may take a little longer for them to reply here.
    Thank you for your patience while we look into this further.

    I hope you have a great day ahead!

    Kind regards,
    Ouissal

  • Alessandro
    • Nightcrawler & Daydreamer

    Daniel Herstedt.

    I am on your issue and currently debugging. There seems to be an issue with the cron related to Scheduled Exports. It’s seems to enter to an infinite loop when ‘Monthly‘ is set as Frequency option.

    We kindly ask to leave your settings as is and avoid updating Forminator. I added a performance logger to your current instance and I am expecting more information on your issue.

    The Scheduled Export seems to work as expected (you should be able to get email notifications). Could you please just confirm if you get an export today?

    I did remove the set_time_limit() from your wp-config.php file as it’s not affecting or resolving your issue.

    I installed WP Crontrol & WP Mail SMTP (are now disabled), to monitor things in real time. Leave it intact, and I ll get them uninstalled as soon as I resolved your case.

    Let us know if you need further assistance.

    Kind regards,
    Alessandro.

  • Alessandro
    • Nightcrawler & Daydreamer

    Hello there.

    Currently there is a monthly export enabled for “Contact Form” element. You can check the settings of this export under “Submissions > Contact Form > Show Submissions > Export > Scheduled Exports” (see attached).

    After doing some tests, since yesterday, I no longer see any errors (Fatal error: Maximum execution) related to the export class.

    Check it out and let us know if the errors persist. Feel free to update Forminator at any time. :blush:

    Kind regards,
    Alessandro.