问题
I have a problem with pthreads in PHP.
When I start apache I see error like this:
php.exe - Entry point not found
The procedure entry point was not found _zend_hash_update@@12 in library D:\xampp\php\ext\php_pthreads.dll
When I execute script in CMD I have a warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'php_pthreads.dll' (tried: D:\xampp\php\ext\php_pthreads.dll
I copied pthreadVC2.dll to:
C:/windows/system32
D:/xampp/php
D:/xampp/apache/bin
And I copied last file php_pthreads.dll to:
D:/xampp/ext
I added to php.ini line with:
extension=php_pthreads.dll
My config:
- XAMPP on Windows 10
- PHP Version 7.3.0
- Compiler: MSVC15 (Visual C++ 2017)
- Architecture: x86
- Thread Safety is enabled
- Thread API is Windows Threads
- php_threads 3.1.6 x86 downloaded from https://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/
I tried in php 7.2.x and i had the same problem but other apache startup error message. Maybe someone can help me.
回答1:
My problem was solved!
My advices:
- Downgrade to 7.2.x version PHP on xampp (because pthreads 3.2.0 is compltible with php 7.2)
- Download and install php_pthreads-3.2.0 (which is compiled MSVC 15 the same as PHP. Link: https://github.com/krakjoe/pthreads/releases)
- Delete pthreadVC2.dll from apache/bin (because it isn't needed)
- Make copy php.ini and save copy as php-cli.ini
- From php.ini remove line with extension=php_pthreads.dll (this line must be exist in php-cli.ini)
Try in CMD command: php --ini and check Loaded Configuration File. That must be set as php-cli.ini. And also try command: php -i and find pthreads in result.
来源:https://stackoverflow.com/questions/54007662/problems-with-pthreads-in-php