dblib_pdo installation error

M373H

Member
Jan 18, 2015
16
0
1
cPanel Access Level
Root Administrator
Hello,

I'm trying to install dblib_pdo on my server but on the last step I always get an error.

PHP version: 5.4
Apache 2.4
CentOS 6.6 64-bit


Here are the steps I performed:

- First I installed FreeTDS using the following:
Code:
wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
tar zfvx freetds-stable.tgz
cd freetds-*; ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --with-gnu-ld; make ; make install
I then created a symlink using the following:
Code:
ln -s /usr/local/freetds/lib/libsybdb.so.5 /usr/lib64/libsybdb.so.5
Then,
Code:
touch /usr/local/freetds/lib/libtds.a
touch /usr/local/freetds/include/tds.h
Then rebuilt Apache.

========

Second installing dblib_pdo:
Code:
wget http://pecl.php.net/get/PDO_DBLIB-1.0.tgz
tar -zxvf PDO_DBLIB-1.0.tgz
cd PDO_DBLIB-1.0
phpize
./configure --with-pdo-dblib=/usr/local/freetds
Until here, everything looks fine and no errors.
However, when I lastly run the following command, it outputs error:

Code:
make ; make install
======

The error:
Code:
/root/PDO_DBLIB-1.0/pdo_dblib.c:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__a                                          ttribute__’ before ‘pdo_dblib_functions’
/root/PDO_DBLIB-1.0/pdo_dblib.c:62: error: ‘pdo_dblib_functions’ undeclared here                                           (not in a function)
/root/PDO_DBLIB-1.0/pdo_dblib.c: In function ‘zm_startup_pdo_dblib’:
/root/PDO_DBLIB-1.0/pdo_dblib.c:196: warning: passing argument 1 of ‘dbmsghandle                                          ’ from incompatible pointer type
/usr/local/freetds/include/sybdb.h:725: note: expected ‘MHANDLEFUNC’ but argumen                                          t is of type ‘int (*)(struct DBPROCESS *, DBINT,  int,  int,  char *, char *, ch                                          ar *, DBUSMALLINT)’
make: *** [pdo_dblib.lo] Error 1
======

I'd really appreciate it if anyone can tell how to solve this issue or review commands I used and see if there is anything wrong, or anything that should be added in order to install the dblib_pdo correctly.

Any answer would be greatly appreciated.

Thank you in advance :)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
Hello,

I am happy to see the issue is now resolved. Would you mind sharing the resolution?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
Hello, some days I struggle with this problem , tell me how did you solve it ?
Hello :)

Could you confirm if you are experiencing the exact same error message, or just general trouble installing the module?

Thank you.
 

stefan.ceparu

Registered
Jun 16, 2016
2
0
1
Romania
cPanel Access Level
Website Owner
Hello,
I have the same problem on Centos 7, PHP v5.6

PDO_DBLIB-1.0/pdo_dblib.c:37:1: error: unknown type name 'function_entry' function_entry pdo_dblib_functions[] .... etc

Can you please help?
 

stefan.ceparu

Registered
Jun 16, 2016
2
0
1
Romania
cPanel Access Level
Website Owner
I've found the solution:

I had to manually edit the pdo_dblib.c file and change function from:

function_entry pdo_dblib_functions[] = {
{NULL, NULL, NULL}
};


to

zend_function_entry pdo_dblib_functions[] = {
{NULL, NULL, NULL}
};


I don't know why this isn't fix by now.