Jump to:

4873 Posts in 7171 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Installing silverstripe 2.4.10 on Postgres constantly fails on db connection

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: 398 Views
  • seba.wagner
    Avatar
    Community Member
    5 Posts

    Installing silverstripe 2.4.10 on Postgres constantly fails on db connection Link to this post

    Hi,

    I am trying to install Silverstripe 2.4.10 on Red Hat with Postgres.

    So I downloaded v2.4.10, I added a new vHost to my httpd.conf:

    <VirtualHost *:80>
    ServerName silverstripe.localhost
    ServerAlias silverstripe.localhost
    ServerAdmin root@silverstripe.localhost
    DocumentRoot /var/www/html/SilverStripe-cms-v2.4.10
    ErrorLog /var/www/html/silverstripe/silverstripe.com-error_log
    CustomLog /var/www/html/silverstripe/silverstripe.com-access_log common
    <Directory "/var/www/html/silverstripe/SilverStripe-cms-v2.4.10">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    I downloaded the postgres package and unpacked it into /var/www/html/silverstripe/SilverStripe-cms-v2.4.10.

    I navigate to the Postgres URL:
    http://silverstripe.localhost/

    It will take me to install.php, I add my Postgres database credentials but Silverstripe constantly tells me it can't connect to the database.

    I verified my credentials by creating a small PHP script:

    <?php
    $db = pg_connect("host=127.0.0.1 port=5432 dbname=SS_mysite user=silverstripe password=");
    $result = pg_query($db, "SELECT * FROM test_table_pgtest");

    while ($row = pg_fetch_row($result)) {
    echo "Id: $row[0] Name: $row[1]";
    echo "<br />\n";
    }
    ?>

    The script executes fine, but silverstripe does not accept the same DB credentials.
    Error is: I couldn't find a database server on '127.0.0.1:5432': PostgreSQL requires a valid username and password to determine if the server exists.

    That is really annoying.

    The Postgres module gives instructions to run:
    dev/build

    Unfortunately also this just results in a 404 error. http://silverstripe.localhost/dev/build simply returns a 404 error.
    What else can I do or check to improve on that?

    Of course the database does exist and the user does work (see my test script that runs quite well).

    Also this dev/build thing does not work at all, it is kind of not clear from the documentation if this is intend to work _before_ you run the installer at all.
    Cause if so ... its kind of strange that the postgres module tells users to run that script upfront installation.

    Thanks
    Sebastian

  • seba.wagner
    Avatar
    Community Member
    5 Posts

    Re: Installing silverstripe 2.4.10 on Postgres constantly fails on db connection Link to this post

    I was able to resolve it ... the host does not include the port definition.
    Somehow an example showed 127.0.0.1:5432 as host definition, asuming SilverStripe wants the port to be defined in the HOST parameter.
    Which is obviously wrong.

    Thanks!
    Sebastian

    398 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.