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.

Themes

Discuss SilverStripe Themes.

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

Trying to change a theme


Reply

14 Posts   2504 Views

Avatar
Semazen

12 May 2010 at 9:03pm Community Member, 11 Posts

Yes, you're quite right. Got an informative message.

Line 35 in /sapphire/core/model/MySQLDatabase.php

35       $this->dbConn = mysql_connect($parameters['server'], $parameters['username'], $parameters['password']);

seems to be the problem. Do I edit that file now?

Thanks

Avatar
Semazen

12 May 2010 at 9:05pm (Last edited: 12 May 2010 9:05pm), Community Member, 11 Posts

Sorry for the duplicate post

Avatar
Willr

12 May 2010 at 9:14pm Forum Moderator, 5511 Posts

Please post the full error message / backtrace.

Avatar
Semazen

12 May 2010 at 11:40pm Community Member, 11 Posts

Yes, of course. Here it is:

[Warning] mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'apcdev_silver' (1)
GET /03/

Line 35 in /home/useraccount/public_html/cms/03/sapphire/core/model/MySQLDatabase.php
Source

26    /**
27     * Connect to a MySQL database.
28     * @param array $parameters An map of parameters, which should include:
29     * - server: The server, eg, localhost
30     * - username: The username to log on with
31     * - password: The password to log on with
32     * - database: The database to connect to
33     */
34    public function __construct($parameters) {
35       $this->dbConn = mysql_connect($parameters['server'], $parameters['username'], $parameters['password']);
36       $this->active = mysql_select_db($parameters['database'], $this->dbConn);
37       $this->database = $parameters['database'];
38       if(!$this->dbConn) {
39          $this->databaseError("Couldn't connect to MySQL database");
40       }
41

Trace

* mysql_connect(apcdev_silver,apcdev_silver,banane6)
Line 35 of MySQLDatabase.php
* MySQLDatabase->__construct(Array)
Line 79 of DB.php
* DB::connect(Array)
Line 112 of main.php

Avatar
Willr

13 May 2010 at 12:13am Forum Moderator, 5511 Posts

Ok so that error means SS cannot connect to your MySQL server. In your install you would of put 'apcdev_silver' as your mysql server / hostname which to me is wrong. Normally this would be a URL or something like 'localhost'. To change it have a look at your mysite/_config file.

Avatar
Semazen

14 May 2010 at 12:11pm (Last edited: 14 May 2010 12:12pm), Community Member, 11 Posts

Thanks Willr, but we're going to uninstall it and start from scratch.

Advice or links to info on two things would help though:

1) How to set the SilverStripe cache directory under /public_html
2) How to change the theme to one of these [url]http://www.theme4.com/free-silverstripe-themes.html[/url]

Thanks
PS. It was easy enough to install. We just couldn't change cache location or change theme.