简体   繁体   English

PHP 警告:PHP 启动:无法加载动态库“php_ibm_db2.dll”

[英]PHP Warning: PHP Startup: Unable to load dynamic library 'php_ibm_db2.dll'

I want to install the db2 extension for PHP on Windows but it just isn't working.我想在 Windows 上安装 PHP 的 db2 扩展,但它就是不工作。 I've tried a lot of different solutions but I still get these:我尝试了很多不同的解决方案,但我仍然得到这些:

php.exe php.exe

phpinfo() phpinfo()

When I try connection to db2 database当我尝试连接到 db2 数据库时

I'm using Apache on XAMPP on port 80. I have installed this: https://github.com/ibmdb/php_ibm_db2/tree/master/PHP%207.4.x/x64/TS and placed it in my C:\xampp\php\ext folder and set "extension=php_ibm_db2.dll" in my php.ini file. I'm using Apache on XAMPP on port 80. I have installed this: https://github.com/ibmdb/php_ibm_db2/tree/master/PHP%207.4.x/x64/TS and placed it in my C:\xampp \php\ext 文件夹并在我的 php.ini 文件中设置“extension=php_ibm_db2.dll”。 (which is in C:\xampp\php) (在 C:\xampp\php 中)

Only "db2" appearing in phpinfo()只有“db2”出现在 phpinfo()

Variable where db2 is appearing db2 出现的变量

PATH variable路径变量

So, I did not manage to connect to my db2 DB with the db2 extension, but here's an alternative I've found -->所以,我没有设法使用 db2 扩展名连接到我的 db2 DB,但这是我找到的替代方案 -->

$database = "xxx";
$hostname = "xxx";
$user     = "xxx";
$password = "xxx";
$port     = 50000;

# Build the connection string
$driver  = "DRIVER={IBM DB2 ODBC DRIVER};";
$dsn     = "DATABASE=$database; " .
           "HOSTNAME=$hostname;" .
           "PORT=$port; " .
           "PROTOCOL=TCPIP; " .
           "UID=$user;" .
           "PWD=$password;";

$conn_string = $driver . $dsn;

# Connect

$conn = odbc_connect( $conn_string, "", "" );
if( $conn )
{
    echo "Connection succeeded.";
    odbc_close( $conn );
}
else
{
    echo "Connection failed.";
}

output --> Connection succeeded. output --> 连接成功。

source --> https://www.ibm.com/docs/en/db2woc?topic=programmatically-php来源 --> https://www.ibm.com/docs/en/db2woc?topic=programmatically-php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP警告:PHP启动:无法加载动态库/usr/lib/php/20151012/php_imap.dll - PHP Warning: PHP Startup: Unable to load dynamic library /usr/lib/php/20151012/php_imap.dll PHP 警告:PHP 启动:无法加载动态库 '\\xampp\\php\\e xt\\php_pgsql.dll - PHP Warning: PHP Startup: Unable to load dynamic library '\xampp\php\e xt\php_pgsql.dll 警告:PHP 启动:无法加载动态库 - Warning: PHP Startup: Unable to load dynamic library PHP 警告:PHP 启动:无法加载动态库 php_curl.dll 不可能找到 - PHP Warning: PHP Startup: Unable to load dynamic library php_curl.dll impossibile find PHP 警告 PHP 启动无法加载动态库 php_pdo_sqlsrv_7_ts_x64.dll - PHP Warning PHP Startup Unable to load dynamic library php_pdo_sqlsrv_7_ts_x64.dll 如何修复 PHP 警告:PHP 启动:无法加载动态库 'ext\\\\php_curl.dll'? - How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'? 如何解决PHP警告:PHP启动:无法加载动态库'php_ffmpeg.dll' - How to fix PHP warning: PHP Startup: Unable to load dynamic library 'php_ffmpeg.dll' PHP 警告:PHP 启动:无法加载动态库“php_fileinfo.dll” - PHP Warning: PHP Startup: Unable to load dynamic library 'php_fileinfo.dll' Windows上的Zend服务器未加载php_ibm_db2.dll - Zend server on Windows not loading php_ibm_db2.dll PHP警告:PHP启动:无法加载动态库 - PHP Warning: PHP Startup: Unable to load dynamic library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM