We are migrating a customer website to our cPanel infrastructure, and some specific parts of his website need to connect to an external Sybase database. In their current infrastructure, they are using PHP 7.3 with pdo_dblib extension integrated with FreeTDS to access that database.
We already have FreeTDS installed on the cPanel server, so let's jump to pdo_dblib installation.
EasyApache 4 web interface doesn't have the option to install pdo_dblib, neither Yum repository has this extension, so I need to manually install it.
I tried to download pdo_dblib with PECL using the following command:
I extracted the .tgz file, entered the folder, and ran the following commands to prepare the compilation (as I have done to other extensions not available in EasyApache 4 web interface):
In the last command, it returns the following error:
I could fix that, by specifying the --with-pdo-dblib parameter, as follows:
But, when I run
I've searched and found this post on cPanel forums saying that this extension looks like an older PECL module with no recent updates.
So instead of download it from PECL, I've downloaded the PHP 7.3.25 source from PHP official website, extracted the source, entered the
I've searched a lot and couldn't find anything to help with this error. Worth mentioning that we tried to recompile FreeTDS with both
I also tried to ignore the errors with
We already have FreeTDS installed on the cPanel server, so let's jump to pdo_dblib installation.
EasyApache 4 web interface doesn't have the option to install pdo_dblib, neither Yum repository has this extension, so I need to manually install it.
I tried to download pdo_dblib with PECL using the following command:
Bash:
/opt/cpanel/ea-php73/root/usr/bin/pecl download pdo_dblib
Bash:
/opt/cpanel/ea-php73/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/ea-php73/root/usr/bin/php-config
Bash:
checking for PDO_DBLIB support via FreeTDS... yes, shared
configure: error: Cannot find FreeTDS in known installation directories
Bash:
./configure --with-pdo-dblib=/usr/local/freetds --with-php-config=/opt/cpanel/ea-php73/root/usr/bin/php-config
make
make it returns this error:
Bash:
/root/PDO_DBLIB-1.0/pdo_dblib.c:37:1: error: unknown type name 'function_entry'
function_entry pdo_dblib_functions[] = {
^
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: braces around scalar initializer [enabled by default]
{NULL, NULL, NULL}
^
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: (near initialization for 'pdo_dblib_functions[0]') [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: initialization makes integer from pointer without a cast [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: (near initialization for 'pdo_dblib_functions[0]') [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: excess elements in scalar initializer [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: (near initialization for 'pdo_dblib_functions[0]') [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: excess elements in scalar initializer [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:38:2: warning: (near initialization for 'pdo_dblib_functions[0]') [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c:62:2: warning: initialization from incompatible pointer type [enabled by default]
pdo_dblib_functions,
^
/root/PDO_DBLIB-1.0/pdo_dblib.c:62:2: warning: (near initialization for 'pdo_dblib_module_entry.functions') [enabled by default]
/root/PDO_DBLIB-1.0/pdo_dblib.c: In function 'zm_startup_pdo_dblib':
/root/PDO_DBLIB-1.0/pdo_dblib.c:196:2: warning: passing argument 1 of 'dbmsghandle' from incompatible pointer type [enabled by default]
dbmsghandle(msg_handler);
^
In file included from /usr/local/freetds/include/sybfront.h:23:0,
from /root/PDO_DBLIB-1.0/php_pdo_dblib_int.h:45,
from /root/PDO_DBLIB-1.0/pdo_dblib.c:32:
/usr/local/freetds/include/sybdb.h:599:13: note: expected 'MHANDLEFUNC' but argument is of type 'int (*)(struct DBPROCESS *, DBINT, int, int, char *, char *, char *, DBUSMALLINT)'
MHANDLEFUNC dbmsghandle(MHANDLEFUNC handler);
^
make: *** [pdo_dblib.lo] Error 1
So instead of download it from PECL, I've downloaded the PHP 7.3.25 source from PHP official website, extracted the source, entered the
ext/pdo_dblib/
directory, and ran the same commands as before. But now, make
command return this error:
Bash:
/root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c: In function 'pdo_dblib_stmt_should_stringify_col':
/root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c:290:35: error: 'DBBIGINT' undeclared (first use in this function)
if (sizeof(zend_long) < sizeof(DBBIGINT)) {
^
/root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c:290:35: note: each undeclared identifier is reported only once for each function it appears in
In file included from /opt/cpanel/ea-php73/root/usr/include/php/Zend/zend.h:27:0,
from /opt/cpanel/ea-php73/root/usr/include/php/main/php.h:33,
from /root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c:24:
/root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c: In function 'pdo_dblib_stmt_get_col':
/root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c:433:22: error: 'DBBIGINT' undeclared (first use in this function)
ZVAL_LONG(zv, *(DBBIGINT *) data);
^
/opt/cpanel/ea-php73/root/usr/include/php/Zend/zend_types.h:745:19: note: in definition of macro 'ZVAL_LONG'
Z_LVAL_P(__z) = l; \
^
/root/php-7.3.25/ext/pdo_dblib/dblib_stmt.c:433:32: error: expected expression before ')' token
ZVAL_LONG(zv, *(DBBIGINT *) data);
^
/opt/cpanel/ea-php73/root/usr/include/php/Zend/zend_types.h:745:19: note: in definition of macro 'ZVAL_LONG'
Z_LVAL_P(__z) = l; \
^
make: *** [dblib_stmt.lo] Error 1
--enable-msdblib
and --enable-sybase-compat
options, but that didn't change the make
command output.I also tried to ignore the errors with
make -i
, but when I ran make install
a similar error was outputted. Even trying make install -i
gave errors:
Bash:
make: [/root/php-7.3.25/ext/pdo_dblib/modules/pdo_dblib.la] Error 1 (ignored)
Installing shared extensions: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/
cp: cannot stat 'modules/*': No such file or directory
make: [install-modules] Error 1 (ignored)
Last edited by a moderator: