0

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.
enter image description here
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();
Community
  • 1
  • 1
SlimenTN
  • 3,383
  • 7
  • 31
  • 78

1 Answers1

0

You should use pthreads 2.0.10 for PHP version 5.5.12. You should also try copying pthreadVC2.dll and php_pthreads.dll at your c:/windows/system32 directory.

Neal C
  • 1
  • 4