I know guys, this question has been answered but belive me before I ask it I followed step by step these two questions but still having the same error.
pthread not working in php
PHP pthreads: Fatal error: Class 'Thread' not found
I have added this line extension=php_pthreads.dll
to the php.ini file located in the apache directory C:\wamp\bin\apache\apache2.4.9\bin\php.ini
.
Also I have the file pthreadVC2.dll
under C:\wamp\bin\apache\apache2.4.9\bin
, and the file php_pthreads.dll
under C:\wamp\bin\php\php5.5.12\ext
.
After that I restarted the wamp server and checked the php_pthreads
extension and it's activated.
I did everything as described but still facing this error.
This is my class that extends from Thread
:
class MyThread extends \Thread
{
public function run()
{
echo 'This is a thread';
}
}
And this is how I called it:
$myThread = new MyThread();
$myThread->start();