简体   繁体   中英

RedHat Software collections and php72 and dblib

I am trying to use php72 on a Centos7 box via Red Hat Software Collections. Everything else seems to be working, but I can't get a connection to SQL Server database via dblib. Earlier I have used remi (on another server) but RHSC seemed somehow more trustworthy.

I thought the package with dblib should be rh-php72-php-pdo-dblib but there isn't that package. I have tried to search all around but nothing helpful surfaced. Am I the only one trying to use that combination or what?

wbr hank

I thought the package with dblib should be rh-php72-php-pdo-dblib but there isn't that package.

Indeed rh-php72-php-pdo-dblib doesn't exists on official Red Hat Software Collections, because it depends on freetds library which is not available on RHEL.

For now, my repository is the only solution.

I also recommend you to read Microsoft SQL Server from PHP

Using pdo_sqlsrv (using Microsoft library) can be a better solution than pdo_dblib (using freetds).

RHSCL seemed somehow more trustworthy.

Indeed, RHSCL is an official Red Hat supported product, while "remi" is a community driven repository, with only "best effort" support.

We have the same issue of unable to find pdo_dblib after upgrading to php 7.X.

We use the below procedure to load pdo_dblib driver on Centos 7.

download source of php from php.net and untar it.

cd php-7.2.X/ext/pdo_dblib/

( make sure freetds and freetds-devel package are installed )

yum install freetds freetds-devel

phpize

php -v

./configure ( if got error create below soft link )

ls -l /usr/lib64/libsybdb.so ln -s /usr/lib64/libsybdb.so /usr/lib/libsybdb.so

./configure

   make

   make install 

echo extension=pdo_dblib.so > /etc/opt/rh/rh-php72/php.d/pdo_dblib.ini

cat /etc/opt/rh/rh-php72/php.d/pdo_dblib.ini

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM