WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#40314 closed defect (bug) (duplicate)

Fatal error: Maximum execution time of 60 seconds exceeded

Reported by: kakshakkalaria Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.3
Component: Import Keywords: has-patch
Focuses: Cc:
PR Number:

Description

When I tried to upload dummy-data.xml file of WooCommerce ( or any other xml file with larger data ) I got Fatal error: Maximum execution time of 60 seconds exceeded in wordpress-path\wp-includes\plugin.php on line 176. So, basically, if there is any XML data file with larger data it's giving Fatal error.

I already set the max_execution_time = 300000 in php.ini file.

Attachments (1)

40314.patch (436 bytes) - added by mp518 3 years ago.
Issue Resolved

Download all attachments as: .zip

Change History (7)

#1 @mp518
3 years ago

  • Keywords has-patch added

I have found solutions in this file wp-includes\deprecated.php
set default limit 60

<?php
@set_time_limit( 60 );

so need to remove or comment this line code.

Last edited 3 years ago by mp518 (previous) (diff)

@mp518
3 years ago

Issue Resolved

#2 follow-up: @alexvorn2
3 years ago

This is by design, so the scripts will not use more time, want you want I think can be added into a plugin that will increase the time, but I think 60 seconds is enough for the page execution code to load/run.

#3 in reply to: ↑ 2 ; follow-up: @kakshak
3 years ago

Replying to alexvorn2:

This is by design, so the scripts will not use more time, want you want I think can be added into a plugin that will increase the time, but I think 60 seconds is enough for the page execution code to load/run.

60 seconds is enough but what if I have a larger file to upload? So, by the plugin the load time is increased but what if I don't want unnecessary code. I think the solution given by @mp518 is correct one.

#4 in reply to: ↑ 3 @alexvorn2
3 years ago

Replying to kakshak:

Replying to alexvorn2:

This is by design, so the scripts will not use more time, want you want I think can be added into a plugin that will increase the time, but I think 60 seconds is enough for the page execution code to load/run.

60 seconds is enough but what if I have a larger file to upload? So, by the plugin the load time is increased but what if I don't want unnecessary code. I think the solution given by @mp518 is correct one.

Function wp_get_http is a deprecated function anyway, right? So it may be removed soon, so I think there is other newer function.

#5 @SergeyBiryukov
3 years ago

  • Component changed from General to HTTP API
  • Keywords close added

Hi @kakshakkalaria, welcome to WordPress Trac! Thanks for the report.

As noted above, wp_get_http() is a deprecated function that neither WordPress core nor WooCommerce uses, so I don't think 40314.patch would help here. If some plugin still uses it, it should be reported to the plugin author.

I already set the max_execution_time = 300000 in php.ini file.

Sounds like this setting didn't work in your environment. This seems like a support issue rather than a bug in WordPress core, so I'd suggest trying the support forums to resolve it: https://wordpress.org/support/.

#6 @ocean90
3 years ago

  • Component changed from HTTP API to Import
  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #34679.

Note: See TracTickets for help on using tickets.