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.

Installing SilverStripe /

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

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

Installing silverstripe 2.4.10 on Postgres constantly fails on db connection


Go to End


2 Posts   1331 Views

Avatar
seba.wagner

Community Member, 5 Posts

21 February 2013 at 3:12pm

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

Avatar
seba.wagner

Community Member, 5 Posts

22 February 2013 at 2:06pm

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