Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you are using Zend Server, the PDO_ODBC extension will be installed automatically starting in version 2021.1. You can enable and disable the extension using the Zend Server User Interface, just as you can do for any extension.

Warning
titleYou need to Enabling PDO_ODBC will disable the odbc, pdo_ibm, and ibm_db2 extensions.

The unixODBC driver creates a linking failure in PHP if any extension using the old SQL-CLI (libdb400.a) driver is also loaded.  This is because there is a naming conflict between the drivers that will cause the linked SQLSetEnvAttrr to be called from the wrong driver, and PHP will fail to start. So, before you can enable the PDO_ODBC extension, you need to disable the odbc, pdo_ibm, and ibm_db2 extensions.  (You need to disable the odbc extension because it uses SQL-CLI instead of unixODBC.  This was done to maintain backward compatibility with older versions of Zend Server).

Before you can use the PDO_ODBC extension in any given version of PHP, you must first disable the odbc, pdo_ibm, and ibm_db2 extensions in that version of PHP.  To do it, go into the Zend Server User Interface.  Navigate to PHP -> phpinfo(), and make a note of the version currently in use.  If you want to use a different version of PHP, please change it at this time.  

Next, navigate to PHP -> Extensions, and select all three of these extensions: ibm_db2, odbc, and pdo_ibm (you can skip any if they are already off, but they are usually all on by default).  With the extensions selected, click the Disable button at the top of the table.  Restart Apache for the change to take effect, by using the restart icon (circular arrow at top right of the page, should be orange because restart is due).

Once the restart is completed, go into PHP -> phpinfo() and make sure none of these three extensions are loaded.

Once again, navigate to PHP -> Extensions. Select PDO_ODBC.  With the extension selected, click the Enable button at the top of the table.  Restart Apache for the change to take effect, by using the restart icon (circular arrow at top right of the page, should be orange because restart is due).

...

 

This will happen automatically in Zend Server.  If you enable PDO_ODBC, the others will be disabled.  If you enable any of the others, PDO_ODBC will be disabled.  It is important to understand that you can not run scripts using incompatible DB2 drivers at the same time.  For example, if you migrate some of your ibm_db2 applications to PDO_ODBC, you must migrate all of your ibm_db2 applications to PDO_ODBC.


ZendPHP - install and enable/disable

...