简体   繁体   English

在 Windows 中安装 pthreads 时遇到问题

[英]Trouble installing pthreads in Windows

PHP Version: 7.4.5 PHP 版本: 7.4.5

I am running a thread-safe version of PHP becuase after doing php -i|findstr "Thread" I get:我正在运行 PHP 的线程安全版本,因为在执行php -i|findstr "Thread"之后我得到:

Thread Safety => enabled
Thread API => Windows Threads

I downloaded the newest version pthreads (3.1.6) from:https://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/ (I tried both the 32 and 64 bit versions).我从:https://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/ (我尝试了 32 位和 64 位版本)下载了最新版本 pthreads(3.1.6)。

I put the pthreadVC2.dll file in my php\ directory and the php_pthreads.dll file in my php\ext\ directory, and add the line extension=php_pthreads.dll to my php.ini file I put the pthreadVC2.dll file in my php\ directory and the php_pthreads.dll file in my php\ext\ directory, and add the line extension=php_pthreads.dll to my php.ini file

Then after running any php command via the command-line (in my case, php -v ) I get the following in the console when trying the 32 bit version:然后在通过命令行运行任何 php 命令后(在我的例子中, php -v )我在尝试 32 位版本时在控制台中得到以下信息:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (%1 is not a valid Win32 application.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (%1 is not a valid Win32 application.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

And this error when trying the 64 bit version:尝试 64 位版本时出现此错误:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (The specified procedure could not be found.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: C:\xampp\php\ext\php_pthreads.dll (The specified procedure could not be found.), C:\xampp\php\ext\php_php_pthreads.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Any ideas?有任何想法吗?

If anybody happens upon this, what solved it for me was fixing my extension_dir setting in my php.ini file to actually pull from the ext folder present in the same directory.如果有人遇到这种情况,为我解决的问题是在我的php.ini文件中修复我的extension_dir设置,以实际从同一目录中的ext文件夹中提取。 That line was commented out so I think it's default was trying to grab extensions from C:\php\ext .该行已被注释掉,所以我认为它的默认设置是尝试从C:\php\ext获取扩展名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM