Jump to:

23453 Posts in 18902 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Maximum execution time of 30 seconds exceeded in MySQLDatabase.php

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1334 Views
  • beren
    Community Member
    9 Posts

    Maximum execution time of 30 seconds exceeded in MySQLDatabase.php Link to this post


    I am new here.
    Been working on my website and i found SilverStripe very nice and cool ;)

    I've learn how to add additional custom Content fields to CMS and created page with total 7 Content Editors.
    I've been adding content to them and after some time got this error after clicking on Save and Publish button.

    Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\framework\model\MySQLDatabase.php on line 120

    This line is:

    $handle = $this->dbConn->query($sql);

    I've been trying to find same issue on web but i did not find. I'been trying to change some timeout values but it does not work also.

    i got XAMPP v. 3.0.12
    PHPMyAdmin version is 3.5.3
    SS verision 3.0.2

    I can edit another page and Save and publish it.

    This can be due to much content added? I've added lots of small 19x19 png files.
    I will try to delete them but anyway I would like to have lot of content on page.. and it should be possible nowadays

    I've deleted all the images (like 100 of them) and the page saved and publish...
    So there is some memory issues.
    Any limitation for Page ?

    It's quite important as my page can be large even without those images. Some images may need to be necessary.
    Any way to make SS use more memory or?

    Any help will be great..

  • Sean
    Forum Moderator
    921 Posts

    Re: Maximum execution time of 30 seconds exceeded in MySQLDatabase.php Link to this post

    If you take away your custom code, saving a generic page works fine in the CMS?

    It's not normal to take more than 30 seconds to query, even on heavily customised page types in the CMS.

    Could you debug what query is running to take so long? (add a var_dump($sql) above the query and run the Save and Publish again)

    What sort of custom code did you add? Any snippets of code to be seen?

    Assuming you're on Windows, I would also advise using "" as the server name in your _config.php file instead of "localhost".
    Sometimes, that's been known to fix performance issues because there have been known issues with DNS and MySQL on Windows.


  • beren
    Community Member
    9 Posts

    Re: Maximum execution time of 30 seconds exceeded in MySQLDatabase.php Link to this post

    Hi Sean,
    Thanks a lot for replaying!

    Sorry for not getting back to you earlier but i was on short holidays.

    I've deleted all of the small images (.png 19x19) and used html entities instead and the page saves.

    My custom code in:


    class Downloads extends SiteTree {
    static $db = array(
       'ServicePacks' => 'HTMLText',
       'CADRasterDownloads' => 'HTMLText',
       'HyperDocDownloads' => 'HTMLText',
       'SuperEditDownloads' => 'HTMLText',
       'OtherDownloads' => 'HTMLText'

    static $has_one = array(
    function getCMSFields() {
          $fields = parent::getCMSFields();
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('ServicePacks', 'ServicePacks tab'));
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('CADRasterDownloads', 'CADRasterDownloads tab'));
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('HyperDocDownloads', 'HyperDocDownloads tab'));
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('SuperEditDownloads', 'SuperEditDownloads tab'));
          $fields->addFieldToTab('Root.Content.Main', new HTMLEditorField('OtherDownloads', 'OtherDownloads tab'));
    return $fields;


    class Downloads_Controller extends ContentController {
    function init() {



    and part of Download.ss is:

    <ul id="tabs">
                   <li><a href="#" name="tab1">Latest versions</a></li>
                   <li><a href="#" name="tab2">Service Packs</a></li>
                   <li><a href="#" name="tab3">CADRaster</a></li>
                   <li><a href="#" name="tab4">HyperDoc</a></li>
                   <li><a href="#" name="tab5">Super Edit</a></li>
                   <li><a href="#" name="tab6">Other</a></li>


                <div id="tab-content">
                   <div id="tab1"><br />$Content</div>
                   <div id="tab2"><br />$ServicePacks</div>
                   <div id="tab3"><br />$CADRasterDownloads</div>
                   <div id="tab4"><br />$HyperDocDownloads</div>
                   <div id="tab5"><br />$SuperEditDownloads</div>
                   <div id="tab6"><br />$OtherDownloads</div>

    with some script to it in the header:

    <script type="text/javascript" src="$ThemeDir/js/jquery-latest.min.js"></script>
             <script type="text/javascript">
                $(document).ready(function() {
                   $('#tab-content').children('div').hide(); // Initially hide all content
                   $("#tabs li:first").attr("id","current"); // Activate first tab
                   $("#tab-content div:first").fadeIn(); // Show first tab content
                   $('#tabs a').click(function(e) {
                      if ($(this).closest("li").attr("id") == "current"){ //detection for current tab
                      $('#tab-content').children('div').hide(); //Hide all content
                      $("#tabs li").attr("id",""); //Reset id's
                      $(this).parent().attr("id","current"); // Activate this
                      $('#' + $(this).attr('name')).fadeIn(); // Show content for current tab

    If I run into this problem again (maybe if I add more content) i will debug this.

    Also, thanks for the tip with server name.
    I think it helped and pages load faster

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.