0

I'm trying to upload a demo content for a template I'm using but it gets stuck and never uploads.

Using Mamp Pro on localhost configuration. Here is the log that I get everytime I try to run the upload:

PHP Fatal error:  Maximum execution time of 60 seconds exceeded in C:\MAMP\htdocs\\wp-includes\wp-db.php on line 1877
PHP Stack trace:
PHP   1. {main}() C:\MAMP\htdocs\\wp-admin\admin-ajax.php:0
PHP   2. do_action() C:\MAMP\htdocs\\wp-admin\admin-ajax.php:91
PHP   3. WP_Hook->do_action() C:\MAMP\htdocs\\wp-includes\plugin.php:453
PHP   4. WP_Hook->apply_filters() C:\MAMP\htdocs\\wp-includes\class-wp-hook.php:323
    PHP   5. stm_demo_import_content() C:\MAMP\htdocs\\wp-includes\class-wp-hook.php:298
PHP   6. WP_Import->import() C:\MAMP\htdocs\\wp-content\plugins\stm-importer\stm-importer.php:241
PHP   7. WP_Import->process_posts() C:\MAMP\htdocs\\wp-content\plugins\stm-importer\wordpress-importer\wordpress-importer.php:106
PHP   8. add_post_meta() C:\MAMP\htdocs\\wp-content\plugins\stm-importer\wordpress-importer\wordpress-importer.php:731
PHP   9. add_metadata() C:\MAMP\htdocs\\wp-includes\post.php:1716
PHP  10. wpdb->insert() C:\MAMP\htdocs\\wp-includes\meta.php:99
PHP  11. wpdb->_insert_replace_helper() C:\MAMP\htdocs\\wp-includes\wp-db.php:1910
PHP  12. wpdb->query() C:\MAMP\htdocs\\wp-includes\wp-db.php:1989   
PHP 13. wpdb->_do_query() C:\MAMP\htdocs\\wp-includes\wp-db.php:1765

php.ini is reconfigured with max_execution_time = 600 and max_input_time = 600

I've added directive TimeOut 600 in httpd.conf (at the end of virtualhost block)

httpd.conf-default timeout directives are both set on 600

wp_config is set with set_time_limit(600);

and .htaccess Mamp-pro is configured so that it overrides it

Despite all of these, I still get the 60 seconds max execution time exceeded. I've browsed this site and many others without luck. I'm no coder so I can't see in the files in the stack trace if there is anything that should be amended.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • 2
    What is the actual query that you are trying to run that takes that much time? – Dekel Sep 09 '17 at 23:44
  • Show us how you've set the max timeout in your htaccess. – M. Eriksson Sep 09 '17 at 23:48
  • I'm trying to upload demo content for a template. The template recommends 300 seconds as it takes a few minutes. I've set it to 600 in a desperate attempt to make it work I confess. – Arnaud Hébrard Sep 09 '17 at 23:50
  • I've not set anything in .htaccess since Mamp Pro is configured to override it – Arnaud Hébrard Sep 09 '17 at 23:51
  • Did you restart apache? – Mihai Sep 09 '17 at 23:51
  • Set up a phpinfo(); function in a test.php file. Visit it to verify that your setting is taking effect. – Jeff Mattson Sep 09 '17 at 23:52
  • yes everytime I made a change somewhere – Arnaud Hébrard Sep 09 '17 at 23:52
  • php.info shows all the right config for all directives – Arnaud Hébrard Sep 09 '17 at 23:53
  • What do you mean by _"Mamp Pro is configured to override it"_ when referring to htaccess? How is it configured to do so? Is "AllowOverride" set to "None"? – M. Eriksson Sep 09 '17 at 23:56
  • Try this out : https://stackoverflow.com/a/25706550/8461611 – rndus2r Sep 10 '17 at 00:00
  • Re .htaccess overriden by mamp pro http://blog-en.mamp.info/2015/02/the-htaccess-file-and-mamp-pro.html – Arnaud Hébrard Sep 10 '17 at 00:01
  • That's not Mamp overriding htaccess. That's how you either enable or disable htaccess files. If you set "AllowOverride" to "All", then you can use htaccess to override Apache settings. Just set it to "All" and then try adding the time limit to the htacccess: `php_value max_execution_time 600` – M. Eriksson Sep 10 '17 at 00:06
  • nope, problem with execution time still here sorry – Arnaud Hébrard Sep 10 '17 at 00:24
  • although I have a 2nd notice and stack trace on the log file despite the 60 seconds exceeded: 'Notice: wp_get_http is deprecated since version 4.4.0! Use WP_Http instead. in C:\MAMP\htdocs\\wp-includes\functions.php on line 3831 [10-Sep-2017 00:13:27 UTC] PHP Stack trace: – Arnaud Hébrard Sep 10 '17 at 00:25
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Sep 10 '17 at 18:40

0 Answers0