Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

Install problems related to MySQL and .htaccess


Reply


3 Posts   1998 Views

Avatar
nethawk

Community Member, 2 Posts

12 January 2009 at 2:19pm

Hi,
i tried to install the cms, but have some problems i want to note and i need help with.

First .htaccess:
I get Internal Server Error, as the .htaccess contains:
<IfModule mod_dir.c>
DirectorySlash Off
</IfModule>
but my apache installation doesn't contain this module.

I removed this part from the .htaccess file to be able to continue
the installation.

The MySQL problem:
I tested this with Version 2.3.0-rc2, the stable version and the nightly build:
Version of MySQL: MySQL 5.0.45-log
Apache/1.3.41 (Unix) mod_perl/1.30 PHP/5.2.6 mod_fastcgi/2.4.6 mod_ssl/2.8.31 OpenSSL/0.9.8i

After entering the username, password data for MySQL and starting the Install process
i get errors related to MySQL:

[User Error] Couldn't run query: insert into `SiteTree_versions` SET `ShowInMenus` = 1, `ShowInSearch` = 1, `Status` = 'Published', `CanViewType` = 'Inherit', `CanEditType` = 'Inherit', `Title` = 'Contact Us', `Content` = 'You can fill this page out with your own content, or delete it and create your own pages.', `URLSegment` = 'contact-us', `LastEdited` = now(), `Created` = now(), `ClassName` = 'Page', `MenuTitle` = null, `MetaTitle` = null, `MetaDescription` = null, `MetaKeywords` = null, `ExtraMeta` = null, `HomepageForDomain` = null, `ProvideComments` = '0', `Sort` = '0', `LegacyURL` = null, `HasBrokenFile` = '0', `HasBrokenLink` = '0', `ReportClass` = null, `ToDo` = null, `ParentID` = '0', `Version` = 1, `RecordID` = 3, `AuthorID` = 0 Incorrect key file for table './silvers/SiteTree_versions.MYI'; try to repair it
POST /install.php

Line 394 in /www/kunden/silvers.xtremeweb.de/ftp/htdocs/sapphire/core/model/MySQLDatabase.php

Source

385    }
386    
387    function databaseError($msg, $errorLevel = E_USER_ERROR) {
388       // try to extract and format query
389       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
390          $formatter = new SQLFormatter();
391          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
392       }
393       
394       user_error($msg, $errorLevel);
395    }
396 }
397
398 /**
399 * A result-set from a MySQL database.
400 * @package sapphire

Trace

* Couldn't run query: insert into `SiteTree_versions` SET `ShowInMenus` = 1, `ShowInSearch` = 1, `Status` = 'Published', `CanViewType` = 'Inherit', `CanEditType` = 'Inherit', `Title` = 'Contact Us', `Content` = '<p>You can fill this page out with your own content, or delete it and create your own pages.<br /></p>', `URLSegment` = 'contact-us', `LastEdited` = now(), `Created` = now(), `ClassName` = 'Page', `MenuTitle` = null, `MetaTitle` = null, `MetaDescription` = null, `MetaKeywords` = null, `ExtraMeta` = null, `HomepageForDomain` = null, `ProvideComments` = '0', `Sort` = '0', `LegacyURL` = null, `HasBrokenFile` = '0', `HasBrokenLink` = '0', `ReportClass` = null, `ToDo` = null, `ParentID` = '0', `Version` = 1, `RecordID` = 3, `AuthorID` = 0 Incorrect key file for table './silvers/SiteTree_versions.MYI'; try to repair it
Line 394 of MySQLDatabase.php
* MySQLDatabase->databaseError(Couldn't run query: insert into `SiteTree_versions` SET `ShowInMenus` = 1, `ShowInSearch` = 1, `Status` = 'Published', `CanViewType` = 'Inherit', `CanEditType` = 'Inherit', `Title` = 'Contact Us', `Content` = '<p>You can fill this page out with your own content, or delete it and create your own pages.<br /></p>', `URLSegment` = 'contact-us', `LastEdited` = now(), `Created` = now(), `ClassName` = 'Page', `MenuTitle` = null, `MetaTitle` = null, `MetaDescription` = null, `MetaKeywords` = null, `ExtraMeta` = null, `HomepageForDomain` = null, `ProvideComments` = '0', `Sort` = '0', `LegacyURL` = null, `HasBrokenFile` = '0', `HasBrokenLink` = '0', `ReportClass` = null, `ToDo` = null, `ParentID` = '0', `Version` = 1, `RecordID` = 3, `AuthorID` = 0 | Incorrect key file for table './silvers/SiteTree_versions.MYI'; try to repair it,256)
Line 102 of MySQLDatabase.php
* MySQLDatabase->query(insert into `SiteTree_versions` SET `ShowInMenus` = 1, `ShowInSearch` = 1, `Status` = 'Published', `CanViewType` = 'Inherit', `CanEditType` = 'Inherit', `Title` = 'Contact Us', `Content` = '<p>You can fill this page out with your own content, or delete it and create your own pages.<br /></p>', `URLSegment` = 'contact-us', `LastEdited` = now(), `Created` = now(), `ClassName` = 'Page', `MenuTitle` = null, `MetaTitle` = null, `MetaDescription` = null, `MetaKeywords` = null, `ExtraMeta` = null, `HomepageForDomain` = null, `ProvideComments` = '0', `Sort` = '0', `LegacyURL` = null, `HasBrokenFile` = '0', `HasBrokenLink` = '0', `ReportClass` = null, `ToDo` = null, `ParentID` = '0', `Version` = 1, `RecordID` = 3, `AuthorID` = 0)
Line 416 of Database.php
* Database->manipulate(Array)
Line 110 of DB.php
* DB::manipulate(Array)
Line 806 of DataObject.php
* DataObject->write()
Line 915 of SiteTree.php
* SiteTree->requireDefaultRecords()
Line 187 of DatabaseAdmin.php
* DatabaseAdmin->doBuild(1)
Line 801 of install.php
* Installer->install(Array)
Line 123 of install.php

After reloading the page, i get the next error:

[User Error] Couldn't run query: INSERT INTO `File` SET ClassName = 'Image', ParentID = 1, OwnerID = 0, Name = 'SilverStripeLogo.png', Filename = 'assets/Uploads/SilverStripeLogo.png', Created = NOW(), LastEdited = NOW(), Title = 'SilverStripeLogo.png' Incorrect key file for table './silvers/File.MYI'; try to repair it
POST /install.php

Line 394 in /www/kunden/silvers.xtremeweb.de/ftp/htdocs/sapphire/core/model/MySQLDatabase.php
Source

385    }
386    
387    function databaseError($msg, $errorLevel = E_USER_ERROR) {
388       // try to extract and format query
389       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
390          $formatter = new SQLFormatter();
391          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
392       }
393       
394       user_error($msg, $errorLevel);
395    }
396 }
397
398 /**
399 * A result-set from a MySQL database.
400 * @package sapphire

Trace

* Couldn't run query: INSERT INTO `File` SET ClassName = 'Image', ParentID = 1, OwnerID = 0, Name = 'SilverStripeLogo.png', Filename = 'assets/Uploads/SilverStripeLogo.png', Created = NOW(), LastEdited = NOW(), Title = 'SilverStripeLogo.png' Incorrect key file for table './silvers/File.MYI'; try to repair it
Line 394 of MySQLDatabase.php
* MySQLDatabase->databaseError(Couldn't run query: INSERT INTO `File` SET ClassName = 'Image', ParentID = 1, OwnerID = 0, Name = 'SilverStripeLogo.png', Filename = 'assets/Uploads/SilverStripeLogo.png', Created = NOW(), LastEdited = NOW(), Title = 'SilverStripeLogo.png' | Incorrect key file for table './silvers/File.MYI'; try to repair it,256)
Line 102 of MySQLDatabase.php
* MySQLDatabase->query(INSERT INTO `File` SET ClassName = 'Image', ParentID = 1, OwnerID = 0, Name = 'SilverStripeLogo.png', Filename = 'assets/Uploads/SilverStripeLogo.png', Created = NOW(), LastEdited = NOW(), Title = 'SilverStripeLogo.png',256)
Line 97 of DB.php
* DB::query(INSERT INTO `File` SET ClassName = 'Image', ParentID = 1, OwnerID = 0, Name = 'SilverStripeLogo.png', Filename = 'assets/Uploads/SilverStripeLogo.png', Created = NOW(), LastEdited = NOW(), Title = 'SilverStripeLogo.png')
Line 160 of Folder.php
* Folder->constructChild(SilverStripeLogo.png)
Line 107 of Folder.php
* Folder->syncChildren()
Line 112 of Folder.php
* Folder->syncChildren()
Line 107 of Filesystem.php
* Filesystem::sync()
Line 811 of install.php
* Installer->install(Array)
Line 123 of install.php

For sure, the initial MySQL installation should succeed.

Thanks

Avatar
Hamish

Community Member, 712 Posts

13 January 2009 at 9:12am

Have you tried repairing the database? That's an odd issue - it looks like mysql didn't create the table correctly. Drop and rebuild might be quicker.

Avatar
nethawk

Community Member, 2 Posts

15 January 2009 at 12:54pm

Checking the content of the tables showed, that the missing entries from the errorpages
were created. Why ? I don't know.

I can't be sure, that all my tables contain the correct content.

Probably it would be a good idea to

1. Create a php script, that queries MySQL, if all data are in the tables.
2. include a MySQL dump in the distribution.

Probably someone could send me a database dump of a clean installation ?

Thanks