PHPコンパイル設定pthreadマルチスレッド全過程

2581 ワード

環境とバージョン:
システム:Centos 7.2
mysql:maridb-10
php包:php-56.36(http://au1.php.net/distributions/php-5.6.36.tar.gz)
pthread:v 2.0.10(https://github.com/krakjoe/pthreads/tree/v2.0.10)
github:https://github.com/krakjoe/pthreads
pthread v 3はPHP 7、v 2はPHP 5に対応しています。
 
pthread v 3バージョンからはcliモード(コマンドライン)のみでスクリプトを実行しますが、他の運転方式のpthreadは失敗します。
以下は著者の説明です。
SAPI Support

pthreads v3 is restricted to operating in CLI only: I have spent many years trying to explain that threads in a web server just don't make sense, after 1,111 commits to pthreads I have realised that, my advice is going unheeded.

So I'm promoting the advice to hard and fast fact: you can't use pthreads safely and sensibly anywhere but CLI.

Thanks for listening ;)
この文章はv 2を選んで構成します。インストール方法と手順はv 3と同じです。
 
インストール手順:
落菵菵php
[root@sxm」シシwgethttp://au1.php.net/distributions/php-5.6.36.tar.gz [root@sxm」〹tar-zxvf php-56.6.tar.gz[root@sxm」落cd php-5.56[]root@sxm」ウィth- config-file- path=/usic=prefix=/usr/local/php 56--with- config-file- path=/usr/local/php 56/ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffwith-pdo-mysql=mysqlnd--with-inconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-pg-dir-。with-zlib--with- libxml-dir=/usr--enable-xml-- disable-rpath--enable-bcmath--enabele- shmop--enable- ssvsem--enaab-inininininininininininininininininininininininininininmiztion--with-with- curll=//usr///usr/local=/usr/locar/local/local/local/local/local/local/local/local/local/local/local/local/local/locacacal/local/th-openssl--with-mhash--enaber-pcntl--enaber-sockets--with-xmlpc--enaber-zip--enabe-soap--with-gettext--enabel-fileinfo--enabel-opcache--enabel-inntl--with-xsl  --enaber-mantainer-zts
璣33859;璣上配置パラメータは自分のmysqlパスに変更してください。
[root@sxm」〹make ZEEND_EXTRA_LIBS='-liconv'
[root@sxm」〹make install
璜璣璖下はphp-fpm serviceを配置して起動します。
[root@sxm」萼install-v-m 755 sapi/fpm/init.d.php-fpm/etc/init.d/php-fpm 56
 
同前
[root@sxm」シシwget https://codeload.github.com/krakjoe/pthreads/zip/v2.0.10
[root@sxm」シシシ unzip v 2.0.10
[root@sxm」シシシ cd pthreads-2.10
[root@sxm」シシシ /usr/local/php 56/bin/phpize
[root@sxm」シシシ ./configre--with-php-config=/usr/local/php 56/bin/php-config
[root@sxm」シシシ make&make install
 
php.iniファイルに追加:
extension=pthreads.so
起動php-fpm:
service php-fpm 56 start
 
これでセットアップ完了です。問題があればメッセージを残してもいいです。