7

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
MaxPowers
  • 171
  • 1
  • 3
  • I am having exactly the same problem when trying to install PDO_INFORMIX on a CentOS 6.3 with PHP 5.3.3. – jap1968 Mar 18 '13 at 08:58
  • I have tried also renaming pdo.ini to 0_pdo.ini but the problem persists: `pdo_informix.so: undefined symbol: php_pdo_register_driver in Unknown on line 0` – jap1968 Mar 18 '13 at 09:21
  • I have same issue to use FreeTDS with pdo_dblib, you got success here? – Siva Jul 09 '13 at 09:02

3 Answers3

1

After method 1, check your ini files and be sure that the pdo.so and pdo_dblib.so files are configured to be loaded. You can do this from the command line with a php -i and look for the "Loaded Configuration File" as well as "Additional .ini files parsed".

Among those files, ensure that extendion=pdo.so is loaded (possibly/probably before your pdo_dblib.so is loaded). If you want to maintain separate .ini files you can control the load order by how a straight ls -al orders the files.

Clint Priest
  • 31
  • 1
  • 5
1

Go back to method one and rebuild freetds with

./configure --enable-msdblib

and possibly

--enable-sybase-compat

If it still fails, post the output of ldd against any .so that fails to load.

chugadie
  • 201
  • 1
  • 5
0

I found this works nowadays:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm && \
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && \
yum update -y && yum install --enablerepo=remi -y \
    php-cli \
    php-fpm \
    php-mssql

You can verify PDO DBLIB installed by sifting the output of the following command:

php -i
b01
  • 123
  • 6