PHP在命令行而不是Apache的mssql_connect工作 [英] PHP mssql_connect works in Command Line but not Apache

查看:134
本文介绍了PHP在命令行而不是Apache的mssql_connect工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想分享一个问题,我正在经历尝试与 mssql_connect连接到远程MSSQL服务器(),从Ubuntu的框。具有相同的php.ini文件和正确的权限,当我通过命令行运行连接脚本的连接将被建立,但不能在浏览器中。

Just wanted to share an issue I was experiencing trying to connect to a remote MSSQL Server with mssql_connect(), from a ubuntu box. With identical php.ini files and correct permissions the connect would be established when I ran the connection script through the command line, but not in the browser.

推荐答案

很多论坛挖我来过这之后:将传给putenv(TDSVER = 70);到脚本或者其他的版本是您ntwdblib.dll。 TDS的图书馆和MS ntwdblib讲了两种不同的协议。希望这有助于。

After much forum digging I came cross this: Add putenv("TDSVER=70"); to your script or whatever the VERSION is for your ntwdblib.dll. The tds library and the MS ntwdblib were speaking two different protocols. Hope this helps.

这篇关于PHP在命令行而不是Apache的mssql_connect工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆