Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with pthreads in PHP

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.

like image 455
Stan Fortoński Developer Avatar asked Dec 24 '22 02:12

Stan Fortoński Developer


1 Answers

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.

like image 117
Stan Fortoński Developer Avatar answered Dec 28 '22 10:12

Stan Fortoński Developer