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
何か案は?