I am trying to enable Thread
with PHP script. I have followed the following steps for enabling PHP thread.
Step 1:- Download and unzip pthread lib from here
Step 2:- Copy php_pthreads.dll
and paste into the php\php7.2.14\ext
and php\php7.2.14\
folder.
Step 3:- and pthreadVC2.dll
and paste into the apache\apache2.4.37\bin
Step 4:- Enable thread in php.ini which is located in apache\apache2.4.37\bin
and after updating its look like something below.
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_extension=On
extension=php_pthreads.dll
Step 5:- Enable thread in php.ini in which located at \php\php7.2.14
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = On
extension=php_pthreads.dll
Step 6:- I have restarted wampp server with all services.
Still, I am getting the error as
Fatal error: Class 'Thread' not found in {PHP file with location with line number}.
Update
I have changed DLL files and restarted a server as we discussed and redirect to a new error as below.
[24-Jan-2019 10:29:20 UTC] PHP Fatal error: The apache2handler SAPI is not supported by pthreads in Unknown on line 0
[24-Jan-2019 10:29:20 UTC] PHP Fatal error: Unable to start pthreads module in Unknown on line 0