Install the PHP Drivers for SQL Serve
sudo pecl install pdo_sqlsrv
sudo pecl install sqlsrv
微软官方文档:https://www.microsoft.com/en-us/sql-server/developer-get-started/php/mac/step/2.html
安装过程中会提示没有权限安装(Operation not permitted),是因为MacOS系统完整性保护,
它在10.11开始启用。它的目的是防止恶意代码对MacOS X的危害,无论是有意还是无意,基本上SIP所做的是锁定文件系统中的特定系统级位置,同时防止某些进程附加到系统级进程。csrutil:启用和禁用SIP
要关闭SIP,我们可以使用 csrutil ,但您会遇到另一个错误
$ csrutil status System Integrity Protection status: enabled. $ csrutil disable csrutil: failed to modify system integrity configuration. This tool needs to be executed from the Recovery OS.
原因是,SIP存储在NVRAM中,而不是存储在文件系统本身中。因此,此配置适用于整个计算机上的所有OS X安装,并且在支持系统完整性保护的OS X安装中保留。
Apple有一个详细的说明: 配置系统完整性保护
要启用或禁用系统完整性保护,您必须启动到Recovery OS并从终端运行csrutil(1)命令。
- 通过重新启动计算机并在启动时按住Command和R键来引导至Recovery OS。
- 从Utilities菜单启动Terminal。
- 输入以下命令: $ csrutil enable
- 需要重新启动