Connection Progress database by PHP (Laravel framework), PDO

4

I need to connect to a Progress database via php I'm using the laravel 5.2 framework but the same documentation supports only the MySQL, Postgres, SQLite and SQL Server databases.

Searching I found very little about how to connect to this DB through PHP one of the few things I found was about connecting through the PDO so I made the code below.

    $dsn = 'odbc:host=xxx.xx.xxx.x;dbname=minhabase;port=99999DataSource:minhadatasource;';
    $user = 'usuario';
    $password = 'minhasenha';

    $pdo = new \PDO($dsn, $user, $password);

Change php.ini (enable Pdo_odbc)

extension=php_pdo_odbc.dll

With the code above the following error appears PDOException in PaginasController.php line 36:

SQLSTATE [IM002] SQLDriverConnect: 0 [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified

Does anyone have any tips on how to solve it? or someone has already made connection to this db through php

    
asked by anonymous 24.06.2016 / 16:04

1 answer

-1

As you said you have already chosen standard database like Postgres SQL

'Default' => 'pgsql',

You need to uncomment the lines that call the pdo and postgres extensions in your php (php.ini)

That is, you need to uncomment the following lines in your php.ini

Extension = pdo_pgsql.so
Extension = pgsql.so

Note:

Do not forget to stop and start your apache after doing this changes.

    
14.05.2017 / 01:12