PHP pthreads Multi-threaded installation and use, Pthreads multithreading
Install pthreads basically need to recompile PHP, plus--enable-maintainer-zts parameters, but with this document very few, bug will be many very many unexpected problems,
Install pthreads basically need to recompile PHP, plus--enable-maintainer-zts parameters, but with this document very few, bug will be many very many unexpected problems, build environment can only hehe, so this thing to play even, True
PHP Extended Download: https://github.com/krakjoe/pthreadsPHP Manual Documentation: http://php.net/manual/zh/book.pthreads.phpInstall script
The code is as follows
Copy Code
#!/bin/sh cd/web/soft/php If [-D
The system uses the Centos6.6, except that MySQL is used by the compiled installation
Start PHP-FPM when the error is as follows:
Starting php-fpm [18-Jan-2016 18:09:29] NOTICE: PHP message: PHP Fatal error: The fpm-fcgi SAPI is not supported by
This article mainly introduces the use of pthreads implementation of the real PHP multi-threading method, has a certain reference value, now share to everyone, the need for friends can refer to
PHP 5.3 or later, using the pthreads PHP extension,
Install pthreads basically need to recompile PHP, plus--enable-maintainer-zts parameter, but use this document very little; Bugs can be a lot of unexpected problems, build environment can only hehe, so this thing to play even if, Real multithreading
Use pthreads to implement real PHP Multithreading (PHP5.3 or later is required ). As I mentioned in my previous article, the performance bottleneck of most websites is not on the PHP server, because it can be easily handled by adding servers or CPU
Php itself is not ideal for multi-threaded processing, but if we use pthreads, the performance will be improved. Let's look at a PHP multi-threaded pthreads example. php itself is not ideal for multi-threaded processing, however, if we use pthreads,
Using pthreads to implement real PHP multithreading I mentioned in my previous article that the performance bottleneck of most websites is not on the PHP server, because it can be easily handled by adding servers or CPU cores horizontally (for
PHP5.3 and later versions use the pthreadsPHP extension to enable PHP to truly support multithreading. Multithreading can greatly shorten program execution time when processing repetitive cyclic tasks. As I mentioned in my previous article, the
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.