【发布时间】: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