Home >Backend Development >PHP Problem >How to enable multi-threading in php

How to enable multi-threading in php

王林
王林Original
2019-09-24 13:04:544790browse

How to enable multi-threading in php

php solution steps to enable multi-threading:

Extension download:https://github.com/krakjoe/pthreads

Manual: http://php.net/manual/zh/book.pthreads.php

##1. Install the php running environment

2. Download extension

unzip pthreads-master.zip
cd pthreads-master
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

3. Add extension

vi /usr/local/php/lib/php.ini

Add:

extension = "pthreads.so"

4. Restart php

pkill php-fpm
/usr/local/php/sbin/php-fpm

Recommended tutorial:

PHP video tutorial

The above is the detailed content of How to enable multi-threading in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn