- Source code: ext/pdo_odbc/CMakeLists.txt
Configure the pdo_odbc
extension.
This extension provides PDO interface for using Unified Open Database Connectivity (ODBC) databases.
- Default:
OFF
- Values:
ON|OFF
Enable the PHP pdo-odbc
extension.
- Default:
OFF
- Values:
ON|OFF
Build extension as shared library.
- Default:
auto
- Values:
auto
,ibm-db2
,iODBC
,unixODBC
, orcustom
Select the ODBC type.
When using auto
, ODBC will be searched automatically and first found library
will be used.
When using custom
or ibm-db2
, also the ODBC_LIBRARY
needs to be set
manually to find the ODBC library.
For example:
cmake -S . -B php-build \
-D PHP_EXT_PDO_ODBC=ON \
-D PHP_EXT_PDO_ODBC_TYPE=custom \
-D ODBC_LIBRARY=/usr/lib/x86_64-linux-gnu/libodbc.so
For example, IBM DB2:
cmake -S php-src -B php-build \
-D PHP_EXT_PDO_ODBC=ON \
-D PHP_EXT_PDO_ODBC_TYPE=ibm-db2 \
-D ODBC_ROOT=/home/db2inst1/sqllib \
-D ODBC_LIBRARY=db2
Where to find the installed ODBC library on the system, or to customize ODBC compile definitions, options, or linker flags can be done with the following variables:
ODBC_COMPILE_DEFINITIONS
- additional compile definitionsODBC_COMPILE_OPTIONS
- additional compile optionsODBC_INCLUDE_DIR
- path with the ODBC include header filesODBC_LIBRARY
- ODBC library name or absolute path to the ODBC libraryODBC_LINK_OPTIONS
- additional linker optionsODBC_ROOT
- the base root directory of the ODBC installation
For example:
cmake -S . -B php-build \
-D PHP_EXT_PDO_ODBC=ON \
-D PHP_EXT_PDO_ODBC_TYPE=custom \
-D ODBC_LIBRARY=/usr/lib/x86_64-linux-gnu/libodbc.so \
-D ODBC_INCLUDE_DIR=/usr/include \
-D ODBC_COMPILE_DEFINITIONS="-DSOME_DEF=1 -DSOME_OTHER_DEF_2=1" \
-D ODBC_COMPILE_OPTIONS=... \
-D ODBC_LINK_OPTIONS=...