我构建了64位版本的php-7.0.10和php-5.6.25,其中包括许多选项:
--with-pdo-odbc=ibm-db2,$IBM_DB2
--with-pdo-oci=instantclient,$ORACLE_VERSION,12.1
--with-pdo-mysql=mysqlnd
--with-pdo-dblib=$LIBS_PREFIX
--with-ibm-db2=$IBM_DB2
用“php -i | egrep -i'db2 | pdo'”报道一切都很好看:
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
Configure Command => './configure' '--enable-bcmath' '--enable-calendar' '--enable-dba=shared' '--enable-exif' '--enable-fpm' '--enable-ftp' '--enable-inline-optimization' '--enable-intl' '--enable-libxml' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-bz2=/versions64/local' '--with-curl=/versions64/local' '--with-freetype-dir=/versions64/local' '--with-gd=/versions64/local' '--with-gdbm=/opt/dweb/chroot-staging/usr/lib64' '--with-gettext=/opt/dweb/chroot-staging/usr/lib64' '--with-icu-dir=/versions64/local' '--with-iodbc=/versions64/local' '--with-jpeg-dir=/versions64/local' '--with-kerberos=/versions64/local' '--with-ldap=/versions64/local' '--with-libxml-dir=/versions64/local' '--with-mcrypt=/versions64/local' '--with-ibm-db2=/opt/IBM/db2/V10.5' '--with-pdo-odbc=ibm-db2,/opt/IBM/db2/V10.5' '--with-mysql=/versions64/mariadb-5.5.50' '--with-mysqli=mysqlnd' '--with-msqls=/versions64/local' '--with-mssql=/versions64/local' '--with-oci8=instantclient,/versions64/oracle_instantclient/instantclient_12_1' '--with-pdo-oci=instantclient,/versions64/oracle_instantclient/instantclient_12_1,12.1' '--with-openssl=/versions64/local' '--with-pcre-regex=/versions64/local' '--with-pdo-mysql=mysqlnd' '--with-pdo-dblib=/versions64/local' '--with-png-dir=/versions64/local' '--with-sybase-ct=/versions64/local' '--with-tidy=/versions64/local' '--with-xsl=/versions64/local' '--with-zlib-dir=/versions64/local' '--with-imap=../../imap-uw-c-client/imap-2007f' '--with-imap-ssl=/versions64/local' '--prefix=/versions64/php-5.6.25' '--with-config-file-path=/versions64/php-5.6.25' 'CC=gcc'
API Extensions => mysqli,pdo_mysql
ODBC library => ibm-db2
ODBC_INCLUDE => -I/opt/IBM/db2/V10.5/include
ODBC_LFLAGS => -L/opt/IBM/db2/V10.5/lib
ODBC_LIBS => -ldb2
PDO
PDO support => enabled
PDO drivers => dblib, mysql, oci, odbc, sqlite
pdo_dblib
PDO Driver for FreeTDS/Sybase DB-lib => enabled
pdo_mysql
PDO Driver for MySQL => enabled
pdo_mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
PDO_OCI
PDO Driver for OCI 8 and later => enabled
PDO_ODBC
PDO Driver for ODBC (ibm-db2) => enabled
pdo_odbc.db2_instance_name => no value => no value
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
然而,使用“db2_connect”的尝试失败了“PHP致命错误:调用未定义函数db2_connect()”
浏览网页有很多文章解释我需要使用PECL来安装db2支持。为什么?上面做了什么?
然后当我尝试'pdo install ibm_db2'时,我收到一条消息,说我需要先安装pdo!它是不是作为原始版本的一部分安装的?
请解释pecl正在做什么./configure + make install没有。