0

PHP Version: 7.4.5

I am running a thread-safe version of PHP becuase after doing php -i|findstr "Thread" I get:

Thread Safety => enabled
Thread API => Windows Threads

I downloaded the newest version pthreads (3.1.6) from: https://windows.php.net/downloads/pecl/releases/pthreads/3.1.6/ (I tried both the 32 and 64 bit versions).

I put the pthreadVC2.dll file in my php\ directory and the php_pthreads.dll file in my php\ext\ directory, and add the line extension=php_pthreads.dll to my php.ini file

Then after running any php command via the command-line (in my case, php -v) I get the following in the console when trying the 32 bit version:

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

And this error when trying the 64 bit version:

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

Any ideas?

Jacob
  • 439
  • 6
  • 19

1 Answers1

0

If anybody happens upon this, what solved it for me was fixing my extension_dir setting in my php.ini file to actually pull from the ext folder present in the same directory. That line was commented out so I think it's default was trying to grab extensions from C:\php\ext.

Jacob
  • 439
  • 6
  • 19