(1) This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712

  根据提示信息进入到: http://go.microsoft.com/fwlink/?LinkId=163712页面,在根据你的服务器所属操作系统,里面有完整的操作步骤说明;

  下面是linux(redhat)下来进行的操作设置:

    

Installing the drivers on Red Hat 7

[!NOTE] To install PHP 7.1 or 7.2, replace remi-php73 with remi-php71 or remi-php72 respectively in the following commands.

Step 1. Install PHP

sudo suwget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmwget https://rpms.remirepo.net/enterprise/remi-release-7.rpmrpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpmsubscription-manager repos --enable=rhel-7-server-optional-rpmsyum install yum-utilsyum-config-manager --enable remi-php73yum updateyum install php php-pdo php-xml php-pear php-devel re2c gcc-c++ gcc

Step 2. Install prerequisites

Install the ODBC driver for Red Hat 7 by following the instructions on the Linux and macOS installation page.

Compiling the PHP drivers with PECL with PHP 7.2 or 7.3 requires a more recent GCC than the default:

sudo yum-config-manager --enable rhel-server-rhscl-7-rpmssudo yum install devtoolset-7scl enable devtoolset-7 bash

Step 3. Install the PHP drivers for Microsoft SQL Server

sudo pecl install sqlsrvsudo pecl install pdo_sqlsrvsudo suecho extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.iniecho extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.iniexit

An issue in PECL may prevent correct installation of the latest version of the drivers even if you have upgraded GCC. To install, download the packages and compile manually (similar steps for pdo_sqlsrv):

pecl download sqlsrvtar xvzf sqlsrv-5.6.0.tgzcd sqlsrv-5.6.0/phpize./configure --with-php-config=/usr/bin/php-configmakesudo make install

You can alternatively download the prebuilt binaries from the Github project page, or install from the Remi repo:

sudo yum install php-sqlsrv

Step 4. Install Apache

sudo yum install httpd

SELinux is installed by default and runs in Enforcing mode. To allow Apache to connect to databases through SELinux, run the following command:

sudo setsebool -P httpd_can_network_connect_db 1

Step 5. Restart Apache and test the sample script

sudo apachectl restart

To test your installation, see Testing your installation at the end of this document.

  (2)A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not

     accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes

    Provider, error: 40 - Could not open a connection to SQL Server)

    这是mssql连接过程中,连接mssql ip地址不通

  (3)code:08001

    

    

转载于:https://www.cnblogs.com/leonchan/p/11301425.html

记-php连接mssql遇上的问题相关推荐

  1. 当 HTTP 连接池遇上 KeepAlive 时

    最近在使用netty作为http客户端通过pool连接tomcat的时候,出现了很多Connection reset by peer 的IOException的异常.便对问题的根源做了细致的调研. 1 ...

  2. 《寻梦环游记》背后:一出“硅谷”遇上“好莱坞”的好戏

    硅谷Live / 实地探访 / 热点探秘 / 深度探讨 现实总比电影精彩. 最近上映的动画片<寻梦环游记>(Coco),大家都看了吗?它简直要把小探的眼泪都赚光了好嘛.. 作为皮克斯动画公 ...

  3. java 双路cpu_当猫头鹰遇上supermicro, 双路E5折腾记

    本帖最后由 findlcy 于 2019-2-19 10:09 编辑 此贴目的原为记录 家里闲置机箱fractal design define c 的装机过程.结果机缘巧合(没做好功课)之下,两个小时 ...

  4. [当人工智能遇上安全] 6.基于机器学习的入侵检测和攻击识别——以KDD CUP99数据集为例

    您或许知道,作者后续分享网络安全的文章会越来越少.但如果您想学习人工智能和安全结合的应用,您就有福利了,作者将重新打造一个<当人工智能遇上安全>系列博客,详细介绍人工智能与安全相关的论文. ...

  5. “直男变暖男”—— 当推荐系统遇上知识图谱

    本文转载自文旅记,详情可以扫描下方二维码: 作为一个文科生,深知文化娱乐.旅游休闲.市场营销等领域正在迎接推荐算法的洗礼,传统的分析.内容生产,势必会发生改变.因此笔者一直关注技术领域,斥巨资(狗头保 ...

  6. 推荐系统遇上深度学习,9篇阿里推荐论文汇总!

    作者 | 石晓文 转载自小小挖掘机(ID: wAIsjwj) 业界常用的推荐系统主要分为两个阶段,召回阶段和精排阶段,当然有时候在最后还会接一些打散或者探索的规则,这点咱们就不考虑了. 前面九篇文章中 ...

  7. 华为平板电脑_当5G遇上平板电脑,华为MatePad Pro 5G带来了什么?

    5G已经来临,科技产品向5G升级已是大势所趋,这更是检验实力的探索之路. 2月24日,华为在巴塞罗那在线发布了一系列新品,其中,华为面向全球推出的5G高端旗舰平板,同时也是全球首款公开发布的5G平板华 ...

  8. 【转发】PHP连接MSSQL数据库案例,PHPWAMP多个PHP版本连接SQL Server数据库

    转发自:http://blog.csdn.net/lccee/article/details/54289076 课前小知识普及:MSSQL和SQL Server是同一个软件,叫法不同而已,MSSQL全 ...

  9. PHP 连接 MSSQL用port时候的注意事项

    项目中用CI的数据库类连接mssql,默认的端口port连接方法是","连接: $this->hostname .= ','.$this->port; 但是在我的电脑上 ...

最新文章

  1. 单片机入门学习笔记7:人机交互界面
  2. linux_unix系统编程手册源代码编译
  3. Codeup墓地-问题 D: 继续畅通工程
  4. VUE.js 中取得后台原生HTML字符串 原样显示问题
  5. Python适合大数据处理吗?
  6. java反射性能问题_Java反射应用实例java反射的性能问题 | 学步园
  7. FTP服务器windows配置
  8. Java8 LocalDateTime和Date相互转换
  9. 升级LINUX内核(支持8G内存)的命令
  10. 计算机视觉应用培训心得体会,计算机视觉专题分享总结(附PPT)
  11. Golang学习资源整理
  12. 实际利率 名义利率
  13. mysql查看sa密码_sqlserver怎么查看sa密码
  14. 汇报措辞:你懂得怎样向领导汇报吗(审阅、审批、批阅、批示、查阅)?
  15. Spark的搭建及实现单词统计
  16. day 11/6 英语词汇
  17. Altium Designer14安装教程及注意事项
  18. 如何下载白纸坊街道卫星地图高清版大图
  19. SpringBoot中集成Redis实现对redis中数据的解析和存储
  20. 阅读笔记|Retrieve and Refine: Exemplar-based Neural Comment Generation

热门文章

  1. gorm查询降序排列
  2. linux fedora35安装Pantheon桌面环境命令整理
  3. linux设置NO_PROXY绕过代理
  4. linux fedora下vscode终端字体间距不正常解决办法
  5. Ansible Playbook企业案例:利用 playbook 安装 nginx、安装和卸载 httpd、安装mysql
  6. scala中object和class关键字的区别
  7. Scala代码案例:求ax2+bx+c=0方程的根
  8. Java客户端操作zookeeper:删除节点代码示例
  9. oracle取本月最后一天是星期几_Oracle取得本月、本年第一天和最后一天
  10. 下载python需要注意什么_用户在对Python下载的时候,这些注意事项不能忽视