• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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