Title: Fatal Error: Maximum execution time&#8230;wp-db.php
Last modified: February 1, 2017

---

# Fatal Error: Maximum execution time…wp-db.php

 *  Resolved [BothHands](https://wordpress.org/support/users/bothhands/)
 * (@bothhands)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-maximum-execution-time-wp-db-php/)
 * I am building my first WP site in an Xampp localhost environment, and am learning
   more than I wanted to know (ha!). I am not from IT.
 * I’m not able to complete the database OPTIMIZATION using the following settings:
   
   a) Optimize InnoDB tables too [yes] b) all tables are UNchecked. No exclusions,
   so ALL tables are to be OPTIMIZED.
 * Three times I have received the following result:
 * **Fatal error:** Maximum execution time of 30 seconds exceeded in **C:\xampp\
   htcos\wordpress\wp-includes\wp-db.php** on line **1877**
 * Line 1877 is the *second line* in the code excerpt below:
    if ( ! empty( $this-
   >dbh ) && $this->use_mysqli ) { $this->result = mysqli_query( $this->dbh, $query);}
   elseif ( ! empty( $this->dbh ) ) { $this->result = mysql_query( $query, $this-
   >dbh );
 * There appear to be 47 tables in my database. The OPTIMIZATION process halts showing
   the 15th table optimized: wp_posts
 * See screen capture image at this URL:
    [http://bothbarrels.net/optimize/fatal-error15.jpg](http://bothbarrels.net/optimize/fatal-error15.jpg)
 * I’m not sure how to terminate the OPTIMIZATION operation, so I just log out of
   WordPress. I hope that is not causing a problem. I let the process run for more
   than one hour the first time and the progress spinner just kept spinning, but
   nothing appeared to be happening. When I finally logged outi the optimization
   results were at table 19…I think.
 * Today I tried OPTIMIZING just 4 tables at a time. Then I ran the OPTIMIZATION
   on the next four tables, and so on until I had OPTIMIZED all 47 tables. It seemed
   to work.
 * Please advise, and please let me know if you need further information.
    Thank
   you, Tom

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-maximum-execution-time-wp-db-php/#post-8725731)
 * Hi Tom,
 * You need to increase the max execution time.
 * Here’s how you can do that:
    [https://docs.oseems.com/general/application/php/increase-max-execution-time](https://docs.oseems.com/general/application/php/increase-max-execution-time)
 * Good luck!
 * peace,
    Rolf
 *  Thread Starter [BothHands](https://wordpress.org/support/users/bothhands/)
 * (@bothhands)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-maximum-execution-time-wp-db-php/#post-8726330)
 * Thank you, Rolf ==
 * Very, very helpful and of course it worked perfectly.
 * For any who are neophytes like me -AND- using Xampp on a local host:
    1. The 
   php.ini file is located here: C:\xampp\php\**php.ini** 2. Shut down and RESTART
   Xampp before you run your next Optimization.
 * I have been experimenting offline (localhost) with a framework theme for several
   months. I make a LOT of page and post revisions, and am amazed at how many your
   fine plugin removes. I’m learning more about WP all the time, and as I begin 
   to understand about databases I appreciate even more your “Optimize Database 
   after Deleting Revisions” plugin. My site is light and nimble purely as a result
   of your efforts, Rolf. If not for your plugin, my site would be a GIGANTIC CONFUSING
   MESS! Ha!
 * The only thing I like better than your plugin is your kind, quick and helpful
   approach to Support.
 * Too good, sez I,
    Tom
 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-maximum-execution-time-wp-db-php/#post-8737925)
 * Hey Tom,
 * Thanks for the kudos!
    I’m glad I could help you.
 * peace,
    Rolf

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Fatal Error: Maximum execution time…wp-db.php’ is closed to new replies.

 * ![](https://ps.w.org/rvg-optimize-database/assets/icon-256x256.png?rev=3350597)
 * [Optimize Database after Deleting Revisions](https://wordpress.org/plugins/rvg-optimize-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rvg-optimize-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rvg-optimize-database/)
 * [Active Topics](https://wordpress.org/support/plugin/rvg-optimize-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rvg-optimize-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rvg-optimize-database/reviews/)

## Tags

 * [excellent support](https://wordpress.org/support/topic-tag/excellent-support/)

 * 3 replies
 * 2 participants
 * Last reply from: [cageehv](https://wordpress.org/support/users/cageehv/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-maximum-execution-time-wp-db-php/#post-8737925)
 * Status: resolved