• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

ODBC-Driver

datFlo

New Pleskian
Is there a way to enable the php functions like odbc_connect?

OS: Debian 8.6
Product Plesk Onyx
Version 17.0.17 Update #6, last updated on Nov 15, 2016 11:39 AM

Thank you in advance for any help :)
 
Hi datFlo,

let's assume, that you installed the PHP5 - extension "php5-odbc", then you should make sure, that it has been enabled with for example "extension = odbc.so" at your depending "php.ini" ( Example: "/etc/php5/apache2/php.ini" ). This can as well being achieved on Debian/Ubuntu based systems, by using the "/etc/php5/apache2/conf.d/" directory and a corresponding symlink from "/etc/php5/mods-available/odbc.ini", where you should see "extension = odbc.so". If this is all set, you are able to use the mentioned functions.
 
Hey @UFHH01 thanks for the fast reply. :)

But new error occured: "mod_fcgid: stderr: PHP Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed, SQL state IM004 in SQLConnect"

Code:
Code:
define('MSSQL_HOST', 'xxx.xxx.xxx'); // external MSSQL-DB under Windows Server2012 
define('MSSQL_USER', 'xxxxxxxxx');              
define('MSSQL_PASS', 'xxxxxxxxxxxx');


    $connection = odbc_connect('Driver={/opt/plesk/php/5.6/lib/php/modules/odbc.so};Server='.MSSQL_HOST.';', MSSQL_USER, MSSQL_PASS);
   $dbQuery = @odbc_exec($connection, '
               USE [TEST]
               SELECT TOP *
               FROM [Tabelle]
           ');
   while($result = @odbc_fetch_array($dbQuery)) {
       echo $result['id']."<br />";
   }
 
Last edited:
Hi datFlo,

it seems, that unixODBC can't create a needed environment ( "SQL_HANDLE_HENV" ). You might consider to add at your "odbc.ini" :

Code:
[conn]
Description= DB2 Driver
Driver = DB2
DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={DB2INSTANCE=db2instl}
 
Back
Top