Update: Looks like I am not doing anything wrong here. When I execute a thread example, it works fine. I am not sure, then why am I getting those errors when I start Apache.
I am trying to install pThread on Xampp (Windows 7) as follows:
My PHP version information: 5.4.7 VC9 x86
I have downloaded
- Then I added
pthreadVC2.dllto C:\xampp\php and
- In php.ini, I have added
Restarted Apache server and received following error:
Any suggestions on why this is not working?
I do not use Windows, but according to the people commenting in the manual, you must also add:
to your httpd.conf (httpd-xampp.conf the manual mentions)
Here is what I did and works for me:
- Check your PHP’s compiler version using phpinfo() as you have already done. Mine and your both is VC9
- Download and install proper Pthread package that matches your compiler version. I downloaded “php_pthreads-0.0.45-5.4-ts-vc9-x86.zip” file. Make sure your OS version also mathes (32-bit or 64-bit).
- Extract Zip file in a temp folder
- Copy php_pthreads.dll to the ‘bin\php\ext\’ folder
- Copy pthreadVC2.dll to the ‘bin\php\’ folder
- Copy pthreadVC2.dll to the ‘bin\apache\bin’ folder
- Copy pthreadVC2.dll to the ‘C:\windows\system32’ folder
- Open php\php.ini and add “extension=php_pthreads.dll” without quotes at the end of file
- Restart server and you won’t get any error message.
copy “pthreadVC2.dll” file to “windows/system32” directory.then restart apache. It worked for me.