ubuntu 16.04 安装多lnmp 及多进程 多线程

来源:互联网 发布:python 股票预测 编辑:程序博客网 时间:2024/06/05 00:59

1 安装 lnmp
命令: apt-get install nginx php mysql-server mysql-client php7.0-mysql
应该是自带 php-fpm 及 mysql 服务 cli 自带。此处完成了基本的lnmp的配置。

2 下载或者上传 php7 源码。解压,进入到对应的pcntl 根目录

3 执行扩展安装。
如果需要使用phpize进行扩展安装,需要添加phpize文件。
apt-get install php-dev 安装phpize
然后执行 phpize && make && make test && make install

4 添加多进程扩展即可。

下面是多线程:
下载多线程 文件:
下载位置:http://pecl.php.net/package/pthreads
上传解压,然后依次执行
phpize
./configure –with-php-config=/usr/bin/php-config –enable-maintainer-zts

最后测试,必须还是要重新编译php,让其支持zend 线程安全才可以使用。

0 0