Connection Progress database by PHP (Laravel framework), PDO

Asked

Viewed 954 times

4

I need to connect to a Progress database via php I am using the framework Laravel 5.2 however the same according to the documentation only has support for Mysql, Postgres, Sqlite and SQL Server databases.

Searching I found very little on how to connect with this DB through PHP one of the few things I found was on how to connect through PDO so I did 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 above code appears the following error Pdoexception in Paginascontroller.php line 36:

SQLSTATE[IM002] Sqldriverconnect: 0 [Microsoft][ODBC Driver Manager] Name of data source not found and no default driver specified

Does anyone have any tips on how to resolve? or has anyone connected to this db through php

  • 3

    That’s not postgres, that’s odbc.

  • 4

    Buddy, before you try to sneak into Laravel and use the direct PDO, look for a library for support. I see many programmers wanting to use a PDO instance in Laravel, and it already has its own ORM. In this case, I would say that it was better not to use framework.

  • 1

    It’s not just changing the database string into a file (if I’m not mistaken the database.php) ?

  • 1

    Based on the @rray comment, you can put this here

  • 2

    Isn’t that a technology called Progress (4GL) that uses SQL Server database? You are not confusing a type of integrated technology with database no?

  • @Miguelbatista Poisé had never heard of Progress as database but I asked the professional I have contact to perform this integration and he answered me so database and Progress compatible with the sql-92 standard

  • I already took a look at the topic: http://stackoverflow.com/questions/30480385/laravel-5-with-postgres-sql ?

Show 2 more comments

1 answer

-1

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

'Default' => 'pgsql',

You must compulsorily 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 :

Don’t forget to stop and start your apache after doing this changes.

  • 2

    Progress != postgresql

Browser other questions tagged

You are not signed in. Login or sign up in order to post.