【问题标题】:Trouble installing pthreads in Windows在 Windows 中安装 pthread 时遇到问题
【发布时间】:2020-05-25 19:49:24
【问题描述】:

PHP 版本: 7.4.5

我正在运行 PHP 的线程安全版本,因为在执行 php -i|findstr "Thread" 之后我得到:

Thread Safety => enabled
Thread API => Windows Threads

我从https://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/ 下载了最新版本的 pthreads (3.1.6)(我尝试了 32 位和 64 位版本)。

我将pthreadVC2.dll 文件放在我的php\ 目录中,将php_pthreads.dll 文件放在我的php\ext\ 目录中,并将extension=php_pthreads.dll 行添加到我的php.ini 文件中

然后通过命令行运行任何 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

尝试 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

有什么想法吗?

【问题讨论】:

    标签: php php-pthread


    【解决方案1】:

    如果有人遇到这种情况,解决这个问题的方法是修复我的php.ini 文件中的extension_dir 设置,以便实际从同一目录中的ext 文件夹中提取。该行已被注释掉,所以我认为它的默认设置是尝试从 C:\php\ext 获取扩展名。

    【讨论】:

      猜你喜欢
      • 2013-04-15
      • 2015-04-01
      • 2012-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-17
      • 2017-01-15
      相关资源
      最近更新 更多