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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Themes /

Discuss SilverStripe Themes.

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

Trying to change a theme


Go to End


14 Posts   4432 Views

Avatar
Semazen

Community Member, 11 Posts

12 May 2010 at 9:03pm

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

Community Member, 11 Posts

12 May 2010 at 9:05pm

Edited: 12/05/2010 9:05pm

Sorry for the duplicate post

Avatar
Willr

Forum Moderator, 5523 Posts

12 May 2010 at 9:14pm

Please post the full error message / backtrace.

Avatar
Semazen

Community Member, 11 Posts

12 May 2010 at 11:40pm

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

Forum Moderator, 5523 Posts

13 May 2010 at 12:13am

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

Community Member, 11 Posts

14 May 2010 at 12:11pm

Edited: 14/05/2010 12:12pm

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 http://www.theme4.com/free-silverstripe-themes.html

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

Go to Top