【发布时间】:2021-04-16 13:34:01
【问题描述】:
过去,我使用 MSSQL 函数设置了与 MSSQL 的连接。我有一个运行 php 5.5 的旧站点(客户端拒绝升级),遗憾的是功能丢失了(它可以工作但现在不行)
我尝试使用下面的脚本重新安装,但在执行php -m 时仍然无法显示模块
Download FreeTDS
Latest stable version can be found here http://www.ibiblio.org/pub/Linux/ALPHA/freetds/stable/ (
3. Configure and install FreeTDS
Uncompress and cd to the respective folder:
./configure --prefix=/usr/local/freetds
make
make install
4. PHP configuration
Edit the php configuration file.
"/usr/local/directadmin/custombuild/configure/ap2/configure.php55"
Add this line: "--with mssql=/usr/local/freetds\ "
Go to custombuild:
./build clean
./build php_expert 5.5 php-fpm
当我再次执行php - m 时,模块不显示
[root@... domains]# php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib
[Zend Modules]
[root@... domains]#
有什么建议吗?
【问题讨论】:
-
您正在尝试使用 MSSQL PHP 扩展(mssql_ 函数)连接到 MS SQL Server,但此扩展在 PHP 5.3 的 Windows 上不再可用,并在 PHP 7.0.0 中删除。
-
@Zhorov 您在评论中指的是 php 5.5 还是 php 5.3?如果 5.3 这是 5.5
-
我的意思是 PHP 5.3。而且我确信
mssql扩展在 Windows 上不再可用,从 PHP 5.3 开始并在 PHP 7.0.0 中删除。我不确定 Linux 平台。此扩展的替代方案是 SQL Server 的 PHP 驱动程序(PDO或sqlsrv_函数),但您需要重写代码。 -
@Zhorov 这本来是在 php 5.6 中工作的,但无论出于何种原因,php 的版本(和版本 8)已经损坏并且不会重新编译:(我已经更新了代码来做 shell现在调用 freetds 的 TSQL 部分
标签: php directadmin php-mssql