Thread Usage in PHP

Asked

Viewed 1,099 times

0

I’m trying to make use of threads in PHP however the "installation" process is not working. I will describe what I am doing.

MISTAKE I GET:

Fatal error: Class 'Thread' not found in.

1.Version of my php. OBS.Use the WAMP

versão 7.0.10

2.I am downloading the files from this site

http://windows.php.net/downloads/pecl/releases/pthreads/0.0.44/

to be more exact the one I’m downloading

php_pthreads-0.0.44-5.3-ts-vc9-x86

3.I am doing what is indicated in the documentation.

3.1 Extracting the .zip -

Move php_pthreads.dll to the directory bin\php\ext\

Move pthreadVC2.dll to the directory bin\php\.

Move pthreadVC2.dll to the directory bin\apache\bin.

Move pthreadVC2.dll to the directory C:\windows\system32.

3.2 Open php.ini and add

Extension = php_pthreads.dll

These are the paths I’m installing.

4.1.I am moving the php_pthreads.dll file to

C:\wamp\bin\php\php7.0.10\ext

4.2. I am moving the file pthreadVC2.dll for

C:\wamp\bin\php\php7.0.10

4.3 I am moving the file pthreadVC2.dll for

C:\wamp\bin\apache\apache2.4.23\bin

4.4 I am moving the file pthreadVC2.dll for

C:\Windows\System32

5.Lastly

I’m putting the name

Extension = php_pthreads.dll

in the archive ini

  • 1

    Is your PHP x64 or x86? Was it compiled in VC9 or VC11 or other? Look at <?php phpinfo(); to know these details. Being php7 I doubt very much that it was compiled in MSVC9

  • Are you using the USE command at the beginning of the file? Ex.: > <?php > USE Thread; > > namespace app Myclass; > class Myclass extends Thread { > //... ;> } ?>

  • Well, I use the XAMP package that contains the version of php 7.0.10.I did all the procedures but XAMP is not recognizing the version of pthreads I installed which is 3.1.6-7.0-ts-vc14-x86.

1 answer

1

You are trying to install the version not compatible with php currently installed. From what I noticed the version used is:

C:\wamp\bin\php\php7.0.10

And you are trying to install a version of the library for php 5.3.x. For 7.x versions of php vc you need the pthreads library in its 3.x version

Check on the link: windows pthreads. And install the most updated version according to your php.

  • Hello ,really had installed an earlier version! only, now that I installed version 3.1.6-7.0-ts-vc14-x86 XAMP is not recognizing. The icon is orange, warning that only 1 of the 3 services is working.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.