PDOException:找不到驱动程序

时间:2017-08-07 03:48:57

标签: php sql-server macos laravel laravel-5.3

我在我的MAC中为php7.1安装了mssql驱动程序

我也检查了我的mssql连接。

TDSVER=8.0 tsql -H yyy.yyy.yy.yy -U xx -D testphp -p 1433 -P xxx

现在我尝试

php artisan migrate:install

我得到以下异常。为什么我仍然会收到此错误?[1]我已经安装了驱动程序和所有

brew install msodbcsql
brew install mssql-tools
brew install autoconf
sudo pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system
 sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv

{1]

 [Illuminate\Database\QueryException]                                         
      could not find driver (SQL: create table "migrations" ("id" int identity pr  
      imary key not null, "migration" nvarchar(191) not null, "batch" int not nul  
      l))                                                                          

      [PDOException]         
      could not find driver 

当我找到pdo_mssql驱动程序时,我会看到以下条目。

/usr/include/php/ext/pdo/php_pdo_driver.h
/usr/local/Cellar/php71/7.1.7_19/lib/php/.registry/.channel.pecl.php.net/pdo_sqlsrv.reg
/usr/local/Cellar/php71/7.1.7_19/lib/php/doc/pdo_sqlsrv

2 个答案:

答案 0 :(得分:0)

请在您的位置创建一个带phpinfo()函数的文件,并检查是否为mssql启用了驱动程序连接。

答案 1 :(得分:0)

运行brew options php71,然后您会看到--with-mssql之类的选项。使用brew install php71 --with-mssql重新安装。

相关问题