Comments (11)
@douglasjunior I wanted to let you know the driver will run on the latest Ubuntu and CentOS. As mentioned before, here is the install steps I go thru for setting up a Laravel Forge server. You should be able to adapt it for your needs. It is an iSeries/AS400.
from laravel-db2.
@douglasjunior No problem. The URL on line 6 will need updated. IBM signs the download URL. You will have to login to IBM and get a new URL.
from laravel-db2.
Hi Douglas,
I've been struggling for the past weeks with the ODBC drivers on Linux. Personally, I succeeded to install the iSeries ODBC on a CentOS 7 VM, and I've been using the old "iSeriesAccess-6.1.0" driver.
It's working up to some extent, and it might work in scope of laravel-db2.
However, the SQL relay I'd like to set up (my other personal project) is not compatible with that driver version. because of some faulty behavior in some cases.
According to what I found on the web, I need the new one called "iAccess" (IBM_i_Access_Client_Solutions_-_Linux_AP_LCD8).
If by any chance, you have an access to the IBM ESS with a product giving you access to that new client, could you please send me an email ? I'm really desperate to find that one for a long time already
If you need the drivers I'm using for CentOS, please contact me by email as well, I'll be glad to share.
Have a nice day
from laravel-db2.
Hello,
Just a question, why are you guys using the ODBC driver and not the PHP PDO? The only reason I can think of is licensing?
Anyway, the PDO is much easier to configure. I created a gist with my install script for the IBM driver and the PDO. You can find that script here. The script was made for Ubuntu/Laravel Forge but it should be a good starting point.
Hope this helps!
from laravel-db2.
Hi @bironeaj,
I'm interested in your approach. Can you please post what's your database.php configuration for ibmi connection?
Many thanks!
from laravel-db2.
@nulele here you go https://gist.github.com/bironeaj/4008e98921dddde46792488c21cb91a1
from laravel-db2.
@wolojonathan, in the end I was able to update Ubuntu 11 where there was the old ODBC already installed. So I did not need to reinstall the driver.
@bironeaj, what do I need to install on Linux to work this way? Is your DB2 an as400?
from laravel-db2.
Thanks, I think the issue can be closed now.
from laravel-db2.
Just to document, I'll add the script here. Thanks @bironeaj!
# Install Dev Package
sudo apt install php7.2-dev
# CD Home
cd ~
# Get CLI
wget -q -O CLI.tar.gz https://iwm.dhe.ibm.com/sdfdl/v2/regs2/smkane/IDSOC/Xa.2/Xb.bL-snMrfTDtX6PgwwuXqAdeiFX6UY09DUuicweVTRlk/Xc.ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz/Xd./Xf.LPr.D1vk/Xg.9810279/Xi.swg-idsoc97/XY.regsrvs/XZ.42v0ODLDocGa6RjgsAKBjJobG6U/ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz
# Get PDO
wget -q -O PDO.tar.gz https://pecl.php.net/get/PDO_IBM-1.3.5.tgz
# Unpack Files & Cleanup
tar -zxf CLI.tar.gz
rm CLI.tar.gz
tar -zxf PDO.tar.gz
rm PDO.tar.gz
# Install CLI
sudo mkdir /opt/ibm/
sudo mv clidriver /opt/ibm/cli
sudo cp -r /opt/ibm/cli/lib /opt/ibm/cli/lib64
# Set CLI ENV Variables
sudo bash -c 'cat <<EOT>> /etc/profile
DB2_CLI_DRIVER_HOME=/opt/ibm/cli
DB2CLIINIPATH=/opt/ibm/cli/cfg
PATH=\$PATH:/opt/ibm/cli/bin
LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/ibm/cli/lib64
EOT'
source /etc/profile
sudo bash -c 'cat <<EOT>> /etc/ld.so.conf.d/db2.conf
/opt/ibm/cli/lib64
EOT'
sudo ldconfig
# Configure CLI
db2cli writecfg add -dsn (WRKRDBDIRE entry) -database (WRKRDBDIRE entry) -host XXX.XXX.XXX.XXX -port 446 -parameter "IsolationLevel=32"
db2cli bind "/opt/ibm/cli/bnd/@db2cli.lst" -dsn (WRKRDBDIRE entry) -user USER -passwd PASS -options "blocking all grant public"
# Install PDO
cd ~/PDO_IBM-1.3.5
sudo phpize7.2
sudo mkdir -p include/php/20170718/ext
sudo cp -r /usr/include/php/20170718/ext/. include/php/20170718/ext/
sudo ./configure --with-pdo-ibm=/opt/ibm/cli
sudo make
sudo make install
# Cleanup
cd ~
sudo rm -rf PDO_IBM-1.3.5
sudo rm package.xml
# Edit php.ini extension=pdo_ibm.so
sudo bash -c 'cat <<EOT>> /etc/php/7.2/cli/php.ini
extension=pdo_ibm.so
EOT'
sudo bash -c 'cat <<EOT>> /etc/php/7.2/fpm/php.ini
extension=pdo_ibm.so
EOT'
# Restart PHP
sudo service php7.2-fpm restart
# Restart nginx
sudo service nginx restart
from laravel-db2.
@nulele here you go https://gist.github.com/bironeaj/4008e98921dddde46792488c21cb91a1
Thank you @bironeaj!!
Just on doubt... if you already define IP, username and password in the script, why declaring them again in the laravel driver configuration?
from laravel-db2.
@nulele Different developers have different logins... Helps maintain the Laravel way of doing versioning on the DB tables
from laravel-db2.
Related Issues (20)
- Laravel 7.x HOT 1
- Bad return value with CCSID 1208 HOT 1
- Problem sending query that contains ยง char HOT 1
- how to add isolation to each query
- Table name using lower case HOT 1
- Posibility for custom Processor HOT 1
- Error typeUuid does not exist
- Error typeTinyInteger does not exist
- DB2 Union Support Lost in Framework Refactor
- Error typeJson does not exist
- Could we add a proper license to this project?
- PDOException could not find driver HOT 4
- set default charset ? HOT 1
- Update for PHP 8.0 HOT 2
- Illuminate DB ^9.0 or Work with Laravel 9
- Problems with charset
- Lumen: Unsupported driver [db2_ibmi_odbc]. HOT 1
- Laravel 10 Support HOT 6
- PHP8 Support? HOT 1
- IBM DB2 integration with Laravel 8 using cooperl/laravel-db2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-db2.