安装PHP7: 下载php
wget http://ar2
.php.net/get/php-
7.0.3.tar.gz/from/this/mirror -O php
.tar.gz
解压文件:
tar xvfz php
.tar.gz
进入目录:
cd php
编译安装: 注意:maintainer-zts 必须安装。 配置:
./configure
--prefix
=/usr/
local/php7
--without
-iconv --enable
-maintainer-zts --with-curl
编译:
make
安装:
make
install
使用 pecl安装 php
cd /usr/local/php7/bin
./pecl install pthreads
安装完成 pthreads 文件。
开启配置文件:
extension= "pthreads.so"
检测是否成功:
/usr/
local/php7/bin
/ -m
编辑php 文件即可测试:
<?php
$thread = new class extends Thread{
public function runc(){
echo "first thread";
}
}
$threads->start() && $threads->join();
搞定
转载请注明原文地址: https://ju.6miu.com/read-667739.html