Php pdo_dblib - cannot find/unable to load freetds

Posted by MaxPowers on Server Fault See other posts from Server Fault or by MaxPowers
Published on 2012-11-07T03:42:32Z Indexed on 2012/11/07 5:02 UTC
Read the original article Hit count: 917

Filed under:
|
|
|
|

Self-hosted box,
RHEL 6
PHP 5.3.3

PDO installed
freetds installed
pdo_dblib - so far no luck installing

My goal is to use PDO with sybase. Attempting to install pdo_dblib from the appropriate version php source code. I have tried a variety of methods and searched quite a bit for help on this topic, but have yet to be successful.

Method 1

Install freetds

$ ./configure
$ make
$ su root
Password: 
$ make install

This is successful

Install pdo_dblib

inside the /ext/pdo_dblib folder:

$ phpize
$ ./configure
$ make
$ make test

Error output:

PHP Warning:  PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so' - /home/sybase/Install_items/php_533_src/php-5.3.3/ext/pdo_dblib/modules/pdo_dblib.so: undefined symbol: php_pdo_register_driver in Unknown on line 0

That doesn't look good...I researched this and found an interesting hack for this here. But changing pdo.ini to pdo_0.ini was not the solution, as I still got the same errors on make test.

$ su
$ make install

Output:

Installing shared extensions:     /usr/lib64/php/modules/

That seems strange...and no, it doesn't actually install (not showing up on phpinfo after apache restart).

Method 2

Install freetds

following the instructions exactly, i add the prefix

$ ./configure --prefix=/usr/local/freetds
$ make
$ su root
Password: 
$ make install

This is successful

Install pdo_dblib

inside the /ext/pdo_dblib folder:

$ phpize
$ ./configure --with-sybase=/usr/local/freetds

This produces the following error at the bottom of the output

...
checking for PDO_DBLIB support via FreeTDS... yes, shared
configure: error: Cannot find FreeTDS in known installation directories

Method 3

freetds ./configure variation (including or not include the --prefix...) did not change the result of this so I'll skip it.

Install pdo_dblib pecl extension

following the method specified here.

pecl download pdo_dblib
tar -xzvf PDO_DBLIB-1.0.tgz

Removed the line,

<dep type=”ext” rel=”ge” version=”1.0?>pdo</dep>

Saved the package.xml file, and moved it in to the PDO_DBLIB directory.

mv package.xml ./PDO_DBLIB-1.0

Navigated to the PDO_DBLIB directory, then installed the package from the directory.

cd ./PDO_DBLIB-1.0
pecl install package.xml

But, this command gives me the following error output, same as Method 2.

checking for PDO_DBLIB support via FreeTDS... yes, shared
configure: error: Cannot find FreeTDS in known installation directories
ERROR: `/home/sybase/Install_items/pecl_pdo_dblib/PDO_DBLIB-1.0/configure' failed

© Server Fault or respective owner

Related posts about php

Related posts about rhel6