Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDO DBLIB Driver for MS SQL Server : Cannot find php_pdo_driver.h

I'm following the tutorial on the link below to compile PDO's DBLIB driver in my Mac Os Mojave.

https://github.com/BellevueCollege/public-docs/blob/master/PHP/configure-mssql-pdodblib-mac.md

Problem is, when i run the code below :

$ cd php-7.2.9/ext/pdo_dblib
$ phpize
$ ./configure --with-php-config=/usr/bin/php-config --with-pdo-dblib=/usr/local/
$ make
$ sudo cp modules/pdo_dblib.so /usr/lib/php/extensions/no-debug-non-zts-20121212

Specifically on this command :

$ ./configure --with-php-config=/usr/bin/php-config --with-pdo-dblib=/usr/local/

I get this error :

configure: error: Cannot find php_pdo_driver.h.

Any ideas please ? I've been trying for the last 2 hours : /

Thanks

like image 523
delphirules Avatar asked Sep 17 '26 06:09

delphirules


2 Answers

actually PDO is included on PHP core. You must install the PHP and MySQL bundled packages.

And follow the following steps to install dblib PDO DBLIB Driver for MS SQL Server : Cannot find php_pdo_driver.h

Check out this solution also: error: cannot find php_pdo_driver.h while installing pdo_mysql

like image 171
Exterminator Avatar answered Sep 19 '26 18:09

Exterminator


After 3 days struggling with this issue, i could find what was wrong.

Because i installed another PHP version in my machine (7.2.9), is was installed not in the default MacOS Mojave folder /usr/bin/php, but instead on /usr/local/php5-7.2.9-20180821-074958. Because of this, on the command below i'd need to change from :

./configure --with-php-config=/usr/bin/php-config --with-pdo-dblib=/usr/local/

To

./configure --with-php-config=/usr/local/php5-7.2.9-20180821-074958/bin/php-config --with-mssql=/usr/local/

After that i could compile the extesion properly.

like image 24
delphirules Avatar answered Sep 19 '26 18:09

delphirules