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.


Our old forums are still available as a read-only archive.

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

Tutorial 'Building a Basic Web Site' - database rebuild

Go to End

17 Posts   9923 Views


2 August 2008 at 12:48pm Community Member, 6 Posts

In the tutorial 'Building a Basic Site', under the Homepage Template section, it suggests rebuilding the database using the URL http://localhost:3000/db/build?flush=1

OK, I'm running a MAMP installation on Mac OSX and need to change the port to 8888.

But I just get a 'Not found on this server' message. The db directory has sub-directories for mysql and sqlite. But nor does http://localhost:8888/db/mysql/build?flush=1 work, either.

I have no idea how to build the database and hence populate it with the tables it apparently needs for the new template page type.


Can someone be a bit more specific about where the "build" address is? i can't see any file called 'build' anywhere....??


BLU42 Media

3 August 2008 at 2:51am Community Member, 71 Posts


I'm also using MAMP with OSX for testing. The port change to 8888 is no problem at all - you'll just need to change the address that you're attempting the rebuild. You don't need to include mysql in the address:




3 August 2008 at 4:13pm Forum Moderator, 5511 Posts

If you have installed SS into a folder within your servers directory then you will need to have that in the url as well. For example if you keep your MAMP sites under Sites/ and you have created a folder called 'SilverStripe' in the sites folder then you need to visit http://localhost:8888/SilverStripe/db/build?flush=1


4 August 2008 at 11:35am Community Member, 6 Posts

Thanks smartplugs and willr.

Will, your method worked...I just needed to direct it to the 'ss' folder under htdocs! OK, I didn't have my head screwed on but then I'm not very techie.

Unfortunately, although the database build appears to have happened, no new pagetype shows up in the behaviour list.


Stuck again....

Bless her soul, I don't think my mum would have got very far with this!



4 August 2008 at 12:02pm Forum Moderator, 5511 Posts

have you created the PHP code file in the correct place? which is a) in the tutorial/code/ folder if you installed silverstripe with the tutorial option or b) mysite/code/ folder if you installed with the black candy option.

Also make sure that your file name matches the class name inside the file (eg for an ArticlePage page type your file needs to be called ArticlePage.php and have this inside it


class ArticlePage extends Page {}

static $db = array();

class ArticlePage_Controller extends Page_Controller {}


And last but not least (after you have made sure you have built the database) make sure that you refresh the CMS so that the dropdown menu can reload the options by going http://localhost:8888/ss/admin?flush=1


4 August 2008 at 12:46pm Community Member, 6 Posts

In answer to your points...

1. Yes, file HomePage.php created inside tutorials/code

2. Just copied and pasted what it said to copy in the tutorial to make the file!...because that's what it said do!!! I do notice that it has the class HomePage. My file in /code is called HomePage.php, and content is thus:

* Defines the HomePage page type

class HomePage extends Page {
static $db = array(
static $has_one = array(


class HomePage_Controller extends Page_Controller {

3. Yes, refreshed the CMS admin several times, logged out, logged back in etc. etc.



4 August 2008 at 3:18pm Forum Moderator, 5511 Posts

Strange. Im out of ideas as to what could be the cause then. Try copying that file to mysite/code/ and run db/build?flush=1 - does anything happen?


6 August 2008 at 12:48pm (Last edited: 6 August 2008 12:48pm), Community Member, 6 Posts

Copied the HomePage.php file to mysite/code and then did a db rebuild with flush.

Nothing other than the normal whirrings and grinding of the machine!...certainly no change in admin - no Home Page option yet available in Behaviour tab. Mac has been shut down and restarted several times and the MAMP server along with it.

Looks like HomePage is not an option for me :(

A pity, I wanted to get into this...

Go to Top