BWICompanies / db2-driver

DB2 for IBM iSeries drop-in Laravel driver
MIT License
15 stars 12 forks source link

PHP Laravel + ODBC Support, attempting to connect to PUB400.com #8

Open NicholasRicher opened 4 months ago

NicholasRicher commented 4 months ago

I'm trying to connect a PHP Laravel Web Application to PUB400.com using this driver. I'm using Laravel 10 and PHP 8.3. I copied and pasted the sample 'myDb2Connection' code into my database.php file and in my .env file I have specified:

DB_CONNECTION=db2 DB_HOST=PUB400.com DB_USERNAME={myUid} DB_PASSWORD={myPwd} DB_DATABASE=A library I created on PUB400.com DB_SCHEMA=CATEGORIES DB_PORT=2222

In my browser I get the message: Database connection [db2] not configured.

I have downloaded and installed the ODBC Driver for IBM i Access Client Solutions on my machine (Mac), specifically the ACS Mac App Pkg and I also have installed "ODBC Manager".

In ODBC Manager under User DSN I have: Name: myDb2 Driver: DB2 Native Driver

And under Drivers I have: Driver: DB2 Native Driver File: /Applications/dsdriver/lib/libdb2.dylib

alanseiden commented 1 month ago

@NicholasRicher Is this still an issue for you?

NicholasRicher commented 1 month ago

On Mac yes, on Windows no. The README says that the PDO_ODBC extension is required but I haven't figured out how to install/enable it on Mac yet. Methods I have investigated so far are trying to install it through unixODBC from Homebrew, trying to build it from source on my Mac and trying to locate my PHP's .ini file to uncomment the line for it like I had to on Windows.