R
R
RainbowPower2019-01-06 20:10:41
PostgreSQL
RainbowPower, 2019-01-06 20:10:41

How to set up a remote server with a database to work with ORM?

Good evening, I have a postgre database on a separate server, and I cannot connect to it using PHP, RedBeanPHP.
Mistake:
Fatal error: Uncaught PDOException: Could not connect to database (?). in /var/www/html/include/redBean/rb-postgres.php:1011 Stack trace: #0 /var/www/html/include/redBean/rb-postgres.php(735): RedBeanPHP\Driver\RPDO- >connect() #1 /var/www/html/include/redBean/rb-postgres.php(1035): RedBeanPHP\Driver\RPDO->runQuery('SELECT table_na...', Array) #2 /var/ www/html/include/redBean/rb-postgres.php(1056): RedBeanPHP\Driver\RPDO->GetAll('SELECT table_na...', Array) #3 /var/www/html/include/redBean/rb -postgres.php(4183): RedBeanPHP\Driver\RPDO->GetCol('SELECT table_na...', Array) #4 /var/www/html/include/redBean/rb-postgres.php(6676): RedBeanPHP \Adapter\DBAdapter->getCol('SELECT table_na...') #5 /var/www/html/include/redBean/rb-postgres.php(5857): RedBeanPHP\QueryWriter\PostgreSQL->
It seems to me that the problem is that the server does not let me in because it does not understand how to work with PDO.
The server is almost bare, it only has Postgre.
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2019-01-06
@RainbowPower

No special settings under ORM are required. Check that there is a route to the server, that the port is not closed by anything, and that connections through the network are allowed in pg_hba.conf.

A
Andrey, 2019-01-06
@VladimirAndreev

You have the psql utility in your system, connect to the database using it and you will understand what the problem is with your settings...
If not, install postgresql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question