When pthread is installed in php, the prompt "Class 'thread' notfound" is displayed.

Source: Internet
Author: User
Php installation pthread prompt ClassThreadnotfound my php version is 5.6.16 the system is 64-bit download pthread for the php_pthreads-2.0.8-5.6-ts-vc11-x64.zip from phpinfo to view the Compiler MSVC11 (Visual C ++ 2012) for vc11, the version of the corresponding

My path is E: \ wamp64 \ bin \ php \ php5.6.16 \
Put php_pthreads.dll in the E: \ wamp64 \ bin \ php \ php5.6.16 \ ext \ directory.
Put pthreadVC2.dll in the E: \ wamp64 \ bin \ php \ php5.6.16 \ directory,
And put pthreadVC2.dll under the system32 directory,
You have also added environment variables and configured apache http. conf to add LoadFile "E:/wamp64/bin/php/php5.6.16/pthreadVC2.dll"

Modified php. ini extension = php_pthreads.dll

Run the following code after restarting apache:

class AsyncOperation extends Thread {  public function __construct($arg){    $this->arg = $arg;  }  public function run(){    if($this->arg){      printf("Hello %s\n", $this->arg);    }  }}$thread = new AsyncOperation("World");if($thread->start())  $thread->join();

Still prompt
Class 'thread' not found

What is the possible cause?



Reply to discussion (solution)

Check whether the Phpinfo function is successfully loaded?

Http://m.blog.csdn.net/article/details? Id = 19020161

Http://m.blog.csdn.net/article/details? Id = 19020161

According to this tutorial, the prompt Class 'thread' not found phpinfo shows that php_pthread is not loaded.

And put pthreadVC2.dll under the system32 directory,

This operation is not available in this tutorial.

And put pthreadVC2.dll under the system32 directory,

This operation is not available in this tutorial.

No. after following this tutorial, the system prompts that this class cannot be found, so I have referred to other tutorials.

Later I referred to this tutorial http://www.thinkphp1.cn/topic/22676.html

Look at the official http://docs.php.net/manual/zh/book.pthreads.php

It seems that the installation is not successful. check whether phpinfo has been installed.

Look at the official http://docs.php.net/manual/zh/book.pthreads.php



It seems that the installation is not successful. check whether phpinfo has been installed.

Phpinfo does not

Look at the official http://docs.php.net/manual/zh/book.pthreads.php

Added according to official documents, or thread not found

Phpinfo does not indicate that the installation has failed. you can change to another version for installation.

Configuration error.

Thank you for your enthusiastic answers to the problem has been solved according to the http://docs.php.net/manual/zh/book.pthreads.php official tutorial configuration of My Integrated Environment wamp in php. when configured in ini, php under php is used. ini, but wamp does not load this php. ini later found php through the wamp icon. ini can be displayed only when the configuration is enabled

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.