问题描述
SQLSRV是PHP唯一能够将 UTF-8 字符串存储到两字节列(NVARCHAR
而不是VARCHAR
)中的驱动程序,Microsoft目前已对其进行维护和支持. PHP 5.2.X和5.3.X.
我还获得了用于下载这些驱动程序的链接 Linux的Linux SQLSRV驱动程序下载,但是我无法配置. /p>
如果有人对如何在linux上配置 sqlsrv 驱动程序有所了解,或者有其他选择可以从 UTF-8 SQL 服务器中检索数据, /em>格式,请分享.
这是Microsoft社区的Wiki帖子
https://github.com /Microsoft/msphpsql/wiki/Install-pdo_sqlsrv-for-PHP-7.0-on-Debian
我认为最简单的途径是php-pear途径
# (1) Install PDO driver from pecl
apt-get install unixodbc-dev php7.0-dev php-pear
pecl install pdo_sqlsrv-4.0.5
echo -e "; priority=20\nextension=pdo_sqlsrv.so" > /etc/php/7.0/mods-available/pdo_sqlsrv.ini
phpenmod -v 7.0 pdo_sqlsrv
SQLSRV is the only driver for PHP that is capable of storing UTF-8 strings into two-byte columns (NVARCHAR
instead of VARCHAR
) which is currently maintained and supported by Microsoft for PHP 5.2.X and 5.3.X.
And I also got the link for downloading these drivers Linux SQLSRV driver download for linux but I could not configure.
If someone has got idea how to configure the sqlsrv driver on linux or has some other alternative to retrieve the data from SQL server in UTF-8 format, please share.
Here's a wiki post from the Microsoft Community
https://github.com/Microsoft/msphpsql/wiki/Install-pdo_sqlsrv-for-PHP-7.0-on-Debian
I think the easiest route would be the php-pear route
# (1) Install PDO driver from pecl
apt-get install unixodbc-dev php7.0-dev php-pear
pecl install pdo_sqlsrv-4.0.5
echo -e "; priority=20\nextension=pdo_sqlsrv.so" > /etc/php/7.0/mods-available/pdo_sqlsrv.ini
phpenmod -v 7.0 pdo_sqlsrv
这篇关于在Linux上安装SQLSRV驱动程序,还是其他支持UTF-8的驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!