Stanisław Fortoński
Stanisław Fortoński

Reputation: 348

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:

I tried in php 7.2.x and i had the same problem but other apache startup error message. Maybe someone can help me.

Upvotes: 4

Views: 5675

Answers (1)

Stanisław Fortoński
Stanisław Fortoński

Reputation: 348

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.

Upvotes: 12

Related Questions