如何使用NTS或TS重新编译PHP? [英] How to recompile PHP with either NTS or TS?

查看:203
本文介绍了如何使用NTS或TS重新编译PHP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使SQLSRV PDO与PHP一起使用。我运行 PHP -v 并收到以下错误

I am trying to get SQLSRV PDO to work with PHP. I run PHP -v and get the following error


警告:PHP启动:pdo_sqlsrv:无法初始化模块

Warning: PHP Startup: pdo_sqlsrv: Unable to initialize module

使用内部版本ID = API20180718,NTS,VC15编译的模块

Module compiled with build ID=API20180718,NTS,VC15

使用内部版本ID = API20180718,TS,VC15编译的PHP

PHP compiled with build ID=API20180718,TS,VC15

这些选项需要匹配

在行0上的未知中

一个不同的错误,其中ID中的日期不匹配,但是我通过获取当前版本的PHP(7.2)并将其放置到位来修复了该错误。它没有安装,而是我解压缩到路径中的压缩存档。然后还必须复制正确的 php.ini 文件。

I was getting a different error where the dates in the IDs didn't match, but I have fixed that by getting the current version of PHP (7.2) and putting that in place. It wasn't installed it was a zipped archive that I extracted into the path. Then had to copy the correct php.ini file in as well.

现在,运行 php -v <时出现上述错误/ code>而不是看到显示的PHP版本信息。

Now I get the above error when running php -v instead of seeing the php version information displayed.

我正在尝试安装CakePHP。我已经到了要安装作曲家的地步。

I am trying to install CakePHP. I have gotten to the point where I'm installing composer. I get this same error when trying to install composer.

所有这些都在我的Web服务器上:Windows Server 2012 R2 Standard x64

All of this is on my web server: Windows Server 2012 R2 Standard x64

怎么办我已解决此问题,以便可以安装Composer?

How do I fix this so that I can install Composer?

推荐答案

在Windows上,您需要TS(线程安全)版本dll而不是NTS(非线程安全)版本。

As you are on Windows, you need the TS (Thread Safe) version of the dll and not the NTS (Not Thread Safe) version.

请确保 php.ini 文件仅加载TS扩展。

Make sure that the php.ini file is loading only the TS extension.

这篇关于如何使用NTS或TS重新编译PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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