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.

Archive

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

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

Running ~/db/build on web server


Reply

5 Posts   1727 Views

Avatar
deadalus.ai

6 July 2008 at 8:38pm Community Member, 3 Posts

Hi. I've installed silverstripe on my live webserver (located in the UK). Silverstripe is up and running OK, but I am unable to rebuild the database after adding a new field to the StaticPage type.

I've successfully added the page on my local test server, and am able to rebuild the database to reflect it by visiting "~/db/build?flush=1".

However, on the webserver the "~/db" URL is reserved for the phpMyAdmin mysql administration program which is part of my web package, and attempting to visit "~/db/build" results in a 404 error.

How do I access the tools which would otherwise be exposed at that URL?

Cheers for any help!

p.s. I have successfully added some of the requisite database fields to the StaticPage tables, in as such that manipulating the database directly shows results when visiting the page (hows the data), and editing the page using the CMS backend will report "success", but the data will not show up. Obviously I'm missing a field or setting somewhere, so it's better to leave it to the automated tool.

Avatar
Willr

6 July 2008 at 10:08pm Forum Moderator, 5511 Posts

How do I access the tools which would otherwise be exposed at that URL?

There is a way to run commands which are available at /db /dev etc by using command line, terminal input and using SilverStripes sake - http://doc.silverstripe.com/doku.php?id=private:sake this is coming in a upcoming release.

How has the host setup /db/ to point to phpMyadmin? If its a .htaccess rule could you rewrite it?

Avatar
deadalus.ai

6 July 2008 at 11:20pm Community Member, 3 Posts

I do not have access to hidden files or much in the way of admin privelages at all. unfortunately I do not have command line access either. The webspace is part of a webfarm, and all webspace management is done using a VHCS Client.

Requests to /db are automatically redirected to phpMyAdmin, just as /vhcs2/filemanager redirects to a web-based file manager.

I'll try to hit up the server administrator to see if he/she can alter the settings for me, but in the meantime is there a way to alter what requests will be mapped to the database tools? (i.e. source changes).

Cheers.

Avatar
simon_w

7 July 2008 at 7:28am Forum Moderator, 474 Posts

In mysite/_config.php, you could add something like:

Director::addRules(100, array(
   'ssdb/$Action' => 'DatabaseAdmin',
));

which would allow you to call ssdb/build?flush=1

Avatar
deadalus.ai

7 July 2008 at 9:03pm Community Member, 3 Posts

Thanks for the reply. Your suggestion was just the thing I was looking for, and worked a treat.

Cheers!