@meet-bhagdev
Thanks for your response.
Thanks for your response.
- Aug 01, 2016 Track tasks and feature requests. Join 40 million developers who use GitHub issues to help identify, assign, and keep track of the features and bug fixes your projects need.
- Connection failed to open the DB connection: could not find driver. But still PHP can not locate PDO for opening connection.
It is helpful to put your code into php tags; they are not available on the quick reply but you have to go to the advanced reply section. As you guessed you need to enable or install a MySQL. If you use PDO SQLSRV on windows 7, using 32 bit php on XAMMP, you might encounter driver problems: 'This extension requires the Microsoft ODBC Driver 11 for SQL Server to communicate with SQL Server'.
[root@dev ~]# odbcinst -q -d -n 'ODBC Driver 13 for SQL Server'
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.0.so.0.0
Threading=1
UsageCount=2 Delta rockwell band saw manual 119 224000.
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.0.so.0.0
Threading=1
UsageCount=2 Delta rockwell band saw manual 119 224000.
[root@dev ~]# php -m
[PHP Modules]
...
PDO
pdo_mysql
PDO_OCI
PDO_ODBC
pdo_sqlite
pdo_sqlsrv
...
sqlsrv
...
[PHP Modules]
...
PDO
pdo_mysql
PDO_OCI
PDO_ODBC
pdo_sqlite
pdo_sqlsrv
...
sqlsrv
...
[Zend Modules]
Zend OPcache
Zend OPcache
Find Driver License Number
[root@dev ~]# php -v
PHP 7.0.9 (cli) (built: Aug 8 2016 12:22:02) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.9, Copyright (c) 1999-2016, by Zend Technologies
PHP 7.0.9 (cli) (built: Aug 8 2016 12:22:02) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.9, Copyright (c) 1999-2016, by Zend Technologies
[root@dev ~]# php -i
...
PDO
PDO support => enabled
PDO drivers => oci, odbc, sqlite, mysql, sqlsrv
...
PDO_ODBC
PDO Driver for ODBC (unixODBC) => enabled
ODBC Connection Pooling => Enabled, strict matching
...
pdo_sqlsrv
pdo_sqlsrv support => enabled
ExtensionVer => 4.0.2.0
Directive => Local Value => Master Value
pdo_sqlsrv.client_buffer_max_kb_size => 10240 => 10240
pdo_sqlsrv.log_severity => 0 => 0
...
sqlsrv
sqlsrv support => enabled
ExtensionVer => 4.0.2.0
Directive => Local Value => Master Value
sqlsrv.ClientBufferMaxKBSize => 10240 => 10240
sqlsrv.LogSeverity => 0 => 0
sqlsrv.LogSubsystems => 0 => 0
sqlsrv.WarningsReturnAsErrors => On => On
...
...
PDO
PDO support => enabled
PDO drivers => oci, odbc, sqlite, mysql, sqlsrv
...
PDO_ODBC
PDO Driver for ODBC (unixODBC) => enabled
ODBC Connection Pooling => Enabled, strict matching
...
pdo_sqlsrv
pdo_sqlsrv support => enabled
ExtensionVer => 4.0.2.0
Directive => Local Value => Master Value
pdo_sqlsrv.client_buffer_max_kb_size => 10240 => 10240
pdo_sqlsrv.log_severity => 0 => 0
...
sqlsrv
sqlsrv support => enabled
ExtensionVer => 4.0.2.0
Directive => Local Value => Master Value
sqlsrv.ClientBufferMaxKBSize => 10240 => 10240
sqlsrv.LogSeverity => 0 => 0
sqlsrv.LogSubsystems => 0 => 0
sqlsrv.WarningsReturnAsErrors => On => On
...
Here you will need to open the zip password file first and then use the password you get to extract the new zip file.c) Run the Windows 7 Activator filed) Click the install button in order to have it installed on your computer and thene) Wait for some few seconds before restarting your computerf) From there you will virtually be good to go.
[root@dev ~]# cat /web/test.php
';} catch ( PDOException $e ) { echo 'The connection failed: ' . $e->getMessage (); }?>result:
The connection failed: could not find driver.
The connection failed: could not find driver.
[root@dev ~]# cat /usr/local/php/etc/php.ini
...
date.timezone = PRC
include_path = '/usr/local/php/lib/php'
extension=php_sqlsrv_7_nts.so
extension=php_pdo_sqlsrv_7_nts.so
zend_extension=opcache.so
...
date.timezone = PRC
include_path = '/usr/local/php/lib/php'
extension=php_sqlsrv_7_nts.so
extension=php_pdo_sqlsrv_7_nts.so
zend_extension=opcache.so
Configure Command:
./buildconf --force
./configure LIBS=-lodbc
--prefix=/usr/local/php
--with-apxs2=/usr/local/httpd/bin/apxs
--with-config-file-path=/usr/local/php/etc
--enable-pdo
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-pdo-mysql=mysqlnd
--with-pdo-oci=instantclient,/usr,12.1.0.2
--with-oci8=instantclient,/usr/lib/oracle/12.1/client64/lib,12.1.0.2
--with-unixODBC=/usr
--with-pdo-odbc=unixODBC,/usr
--with-sqlite3
--with-pdo-sqlite
--with-iconv=/usr/local/libiconv
--with-zlib=/usr/local/zlib
--with-zlib-dir=/usr/local/zlib
--with-openssl=/usr/local/ssl
--with-pcre-dir=/usr/local/pcre
./buildconf --force
./configure LIBS=-lodbc
--prefix=/usr/local/php
--with-apxs2=/usr/local/httpd/bin/apxs
--with-config-file-path=/usr/local/php/etc
--enable-pdo
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-pdo-mysql=mysqlnd
--with-pdo-oci=instantclient,/usr,12.1.0.2
--with-oci8=instantclient,/usr/lib/oracle/12.1/client64/lib,12.1.0.2
--with-unixODBC=/usr
--with-pdo-odbc=unixODBC,/usr
--with-sqlite3
--with-pdo-sqlite
--with-iconv=/usr/local/libiconv
--with-zlib=/usr/local/zlib
--with-zlib-dir=/usr/local/zlib
--with-openssl=/usr/local/ssl
--with-pcre-dir=/usr/local/pcre
or
./buildconf --force
./configure LIBS=-lodbc
--prefix=/usr/local/php
--with-apxs2=/usr/local/httpd/bin/apxs
--with-config-file-path=/usr/local/php/etc
--enable-pdo=shared
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-pdo-mysql=shared,mysqlnd
--enable-mysqlnd
--with-sqlite3=shared,/usr/local/sqlite3
--with-pdo-sqlite=shared,/usr/local/sqlite3
--with-pdo-oci=shared,instantclient,/usr,12.1.0.2
--with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib,12.1.0.2
--with-unixODBC=shared,/usr
--with-pdo-odbc=shared,unixODBC,/usr
--with-iconv=/usr/local/libiconv
--with-zlib=/usr/local/zlib
--with-zlib-dir=/usr/local/zlib
--with-openssl=/usr/local/ssl
--with-pcre-dir=/usr/local/pcre
./configure LIBS=-lodbc
--prefix=/usr/local/php
--with-apxs2=/usr/local/httpd/bin/apxs
--with-config-file-path=/usr/local/php/etc
--enable-pdo=shared
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-pdo-mysql=shared,mysqlnd
--enable-mysqlnd
--with-sqlite3=shared,/usr/local/sqlite3
--with-pdo-sqlite=shared,/usr/local/sqlite3
--with-pdo-oci=shared,instantclient,/usr,12.1.0.2
--with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib,12.1.0.2
--with-unixODBC=shared,/usr
--with-pdo-odbc=shared,unixODBC,/usr
--with-iconv=/usr/local/libiconv
--with-zlib=/usr/local/zlib
--with-zlib-dir=/usr/local/zlib
--with-openssl=/usr/local/ssl
--with-pcre-dir=/usr/local/pcre
[root@dev ~]# httpd -V
Server version: Apache/2.4.23 (Unix)
Server built: Aug 8 2016 01:24:13
Server's Module Magic Number: 20120211:61
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with..
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT='/usr/local/httpd'
-D SUEXEC_BIN='/usr/local/httpd/bin/suexec'
-D DEFAULT_PIDLOG='logs/httpd.pid'
-D DEFAULT_SCOREBOARD='logs/apache_runtime_status'
-D DEFAULT_ERRORLOG='logs/error_log'
-D AP_TYPES_CONFIG_FILE='conf/mime.types'
-D SERVER_CONFIG_FILE='conf/httpd.conf'
Server version: Apache/2.4.23 (Unix)
Server built: Aug 8 2016 01:24:13
Server's Module Magic Number: 20120211:61
Server loaded: APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with..
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT='/usr/local/httpd'
-D SUEXEC_BIN='/usr/local/httpd/bin/suexec'
-D DEFAULT_PIDLOG='logs/httpd.pid'
-D DEFAULT_SCOREBOARD='logs/apache_runtime_status'
-D DEFAULT_ERRORLOG='logs/error_log'
-D AP_TYPES_CONFIG_FILE='conf/mime.types'
-D SERVER_CONFIG_FILE='conf/httpd.conf'
The test URL:
http://i-up.vicp.cc/info.php
http://i-up.vicp.cc/pdo-test.php
http://i-up.vicp.cc/info.php
http://i-up.vicp.cc/pdo-test.php
Compiled into static or dynamic modules can not solve this problem.
The problem has been bothering me for a lot of days. Hope to get your help.thanks.
The problem has been bothering me for a lot of days. Hope to get your help.thanks.