Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NicholasRicher opened this issue Jul 19, 2024 · 2 comments
Open

Comments

@NicholasRicher
Copy link

NicholasRicher commented Jul 19, 2024

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
Copy link
Collaborator

@NicholasRicher Is this still an issue for you?

@NicholasRicher
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants