用于Windows的PHP 7.0 ODBC驱动程序
我将
PHP 5.6.30(
https://www.apachefriends.org/de/download.html)升级到PHP 7.0(
https://bitnami.com/stack/wamp/installer)
到目前为止,一切都运行良好,当我使用MySQL数据库时,它将我的页面的加载时间从1,2秒减少到约300毫秒.但是现在我正在尝试使用以下简单脚本连接到MSSQL数据库,这对我的旧安装(PHP 5.6)工作正常: <?php //Use the machine name and instance if multiple instances are used $server = 'Server-Adress'; $user = ''; $pass = ''; //Define Port $port='Port=1433'; $database = 'Databasename'; $connection_string = "DRIVER={SQL Server};SERVER=$server;$port;DATABASE=$database"; $conn = odbc_connect($connection_string,$user,$pass); if ($conn) { echo "Connection established."; } else{ die("Connection could not be established."); } $sql = "SELECT * FROM st3_200 WHERE identifier = 1"; $result = odbc_exec($conn,$sql); // Get Data From Result while ($data[] = odbc_fetch_array($result)); // Free Result odbc_free_result($result); // Close Connection odbc_close($conn); // Show data print_r($data); ?> 但是现在我的日志中出现了一个错误:
首先我想,我的php.ini有一个缺少的扩展名,所以我启用了“extension = php_pdo_odbc.dll” 与5.6版本中的php.ini的区别在于有扩展名: 所以我的意图是没有odbc和PHP 7的现有驱动程序了吗? 但是我的Windows环境需要一些东西. 有没有人有同样的问题,并已修复它? 谢谢和问候 解决方法
看看你的php.ini,字符串
extension=php_odbc.dll 似乎在新安装中缺少,至少我必须在我的新XAMPP安装中手动添加它(7.0.1)并意外地只是激活了pdo_odbc.dll (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 在Windows中重新运行docker-compose表示网络配置已更改
- windows-server-2008-r2 – 为什么使用不同用户通过PowerSh
- windows-7 – Windows 7中的SMTP本地服务器? (运行IIS7)
- Windows 2012 R2 中的AD DS部署
- 将DLL C类库移植到Visual Studio的问题
- 在windows下安装memcache
- windows-server-2008 – 为什么我不能拖放文件在Windows Se
- windows-server-2008-r2 – Windows Server 2008 R2上的所有
- Win32,如何用C挂钩编译程序中的函数?
- iis-7 – 在线认证机构,无法选择.
- windows-phone-7 – WP7工具包:ListBox上的手势
- Flutter开发环境配置-Windows
- remote-desktop – 远程桌面事件ID 20499.没有明
- 如何在WindowStyle =“None”的WPF窗口中执行Min
- windows-phone-8 – 从Windows Phone 8设备检索崩
- windows-server-2008 – Active Directory用户和
- 终端服务 – 如何阻止Windows应用程序窃取焦点
- windows – 如何使用get-adgroupmember从活动目录
- microsoft-office-365-将office365企业办公室201
- winapi – 哪种api可以在Windows中安装文件系统驱