Jump to:

4938 Posts in 16827 Topics by 1490 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Installing SS with PostgreSQL 9.0

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

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

Page: 1
Go to End
Author Topic: 1872 Views
  • PinkAlert
    Avatar
    Community Member
    7 Posts

    Installing SS with PostgreSQL 9.0 Link to this post

    Hello!

    I am currently trying to install SilverStripe with PostgreSQL 9.0 database on Mac OS X with MAMP. I created the database with pgAdmin3 and installed and placed the postgresql module in the SilverStripe directory. The only thing left is to enter the details about the database.

    When I enter this:
    Database server: localhost:5432
    Database username: postgres
    Password: (not going to show this here )
    Database name: SS_Test

    I get the following message...
    "I couldn't find a database server on 'localhost:5432': PostgreSQL requires a valid username and password to determine if the server exists."

    I am sure that the database properties are alright (I have looked at the properties in pgAdmin3) and that my username and password are alright (I am able to connect to the server with those credentials with pgAdmin3).

    So... Am I doing something wrong?

    Thanks for any help!

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Installing SS with PostgreSQL 9.0 Link to this post

    Try setting the server to "localhost" (lose the ":5432" port bit).

    I'm pretty sure 5432 is the default port, anyway.

    Sean

  • PinkAlert
    Avatar
    Community Member
    7 Posts

    Re: Installing SS with PostgreSQL 9.0 Link to this post

    It worked! Thank you!

  • PinkAlert
    Avatar
    Community Member
    7 Posts

    Re: Installing SS with PostgreSQL 9.0 Link to this post

    When I clicked the install button at the end I got the following error... :S

    Setting up 'mysite/_config.php'...
    Setting up /Applications/MAMP/htdocs/SilverStripe/mysite/_config.php
    Setting up '.htaccess' file...
    Setting up /Applications/MAMP/htdocs/SilverStripe/.htaccess
    Building database schema...
    [Warning] pg_query() [function.pg-query]: Query failed: ERROR: relation "SiteTree_versions" does not exist LINE 2: FROM "SiteTree_versions" GROUP BY "RecordID", "Version... ^
    POST /SilverStripe/install.php

    Line 174 in /Applications/MAMP/htdocs/SilverStripe/postgresql/code/PostgreSQLDatabase.php

    Source

    165       if(isset($_REQUEST['previewwrite']) && in_array(strtolower(substr($sql,0,strpos($sql,' '))), array('insert','update','delete','replace'))) {
    166          Debug::message("Will execute: $sql");
    167          return;
    168       }
    169
    170       if(isset($_REQUEST['showqueries'])) {
    171          $starttime = microtime(true);
    172       }
    173
    174       $handle = pg_query($this->dbConn, $sql);
    175       
    176       if(isset($_REQUEST['showqueries'])) {
    177          $endtime = round(microtime(true) - $starttime,4);
    178          Debug::message("\n$sql\n{$endtime}ms\n", false);
    179       }
    180       

    Trace

    pg_query(Resource id #753,SELECT MIN("ID") AS "ID", "RecordID", "Version" FROM "SiteTree_versions" GROUP BY "RecordID", "Version" HAVING COUNT(*) > 1)
    Line 174 of PostgreSQLDatabase.php
    PostgreSQLDatabase->query(SELECT MIN("ID") AS "ID", "RecordID", "Version" FROM "SiteTree_versions" GROUP BY "RecordID", "Version" HAVING COUNT(*) > 1,256)
    Line 127 of DB.php
    DB::query(SELECT MIN("ID") AS "ID", "RecordID", "Version" FROM "SiteTree_versions" GROUP BY "RecordID", "Version" HAVING COUNT(*) > 1)
    Line 303 of Versioned.php
    Versioned->augmentDatabase(,,,,,,)
    Line 963 of Object.php
    Object->extend(augmentDatabase,)
    Line 3012 of DataObject.php
    DataObject->requireTable()
    Line 209 of DatabaseAdmin.php
    DatabaseAdmin->doBuild(1)
    Line 1026 of install.php
    Installer->install(Array)
    Line 190 of install.php

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Installing SS with PostgreSQL 9.0 Link to this post

    Please try using the trunk version of the postgresql module instead of the stable version. I think the "stable" one doesn't work with 2.4.2. You can grab the trunk release on the PostgreSQL page in the Extensions area of this site.

  • PinkAlert
    Avatar
    Community Member
    7 Posts

    Re: Installing SS with PostgreSQL 9.0 Link to this post

    Thank you again Sean! That worked!

  • gour
    Avatar
    Community Member
    22 Posts

    Re: Installing SS with PostgreSQL 9.0 Link to this post

    Please try using the trunk version of the postgresql module instead of the stable version.

    I installed SS-2.4.5 with the trunk of Postgresql module on my localhost, but it fails on my 'production' server.

    Installer says:

    I couldn't find a database server on 'localhost': PostgreSQL requires a valid username and password to determine if the server exists.

    .

    The settings for 'database server' is localhost. Username, database name & password are OK since I can access database via cli:

    [gour@s9 gour] psql -U gour -h localhost gour_ss
    Password for user gour:
    Welcome to psql 8.3.14, the PostgreSQL interactive terminal.

    Type: \copyright for distribution terms
    \h for help with SQL commands
    \? for help with psql commands
    \g or terminate with semicolon to execute query
    \q to quit

    SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)

    gour_ss=> \q
    [gour@s9 gour]

    Any hint?

    Is it maybe problem due to encryption?

    Edit: My localhost postgresql is 9.x, while the error is on the server with 8.3.

    1872 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.