您好,欢迎访问一九零五行业门户网

swoole如何安装(全纪录分享)

今天swoole栏目带大家分享swoole安装的全纪录,有需要的朋友可以看看,了解了解,有问题欢迎留言讨论。
swoole安装全纪录ondřej surý 的 php ppa 为 ubuntu 16.04/14.04 提供了 php7.2 版本,软件源安装的 php 默认以 unix socket 的状态运行在 /run/php/php7.2-fpm.sock,比使用 tcp 以 localhost:9000 的方式性能更好。
1、安装软件源拓展工具:apt -y install software-properties-common apt-transport-https lsb-release ca-certificates2、添加php ppa 源 并更新缓存add-apt-repository ppa:ondrej/php  & apt update3、安装php7.2及基础相关拓展apt install php7.2-fpm php7.2-mysql php7.2-curl php7.2-gd php7.2-mbstring php7.2-xml php7.2-xmlrpc php7.2-zip php7.2-opcache php7.2-dev -y4、查看当前ppa源有哪些可供直接安装的源apt-cache search php7.2
php-radis - radis client library for php
php-http - pecl http module for php extended http support
php-uploadprogress - file upload progress tracking extension for php
php-yaml - yaml-1.1 parser and emitter for php
php-mongodb - mongodb driver for php
php-apcu - apc user cache for php
php-imagick - provides a wrapper to the imagemagick library
php-ssh2 - bindings for the libssh2 library
php-redis - php extension for interfacing with redis
php-memcached - memcached extension module for php, uses libmemcached
php-apcu-bc - apcu backwards compatibility module
php-rrd - php bindings to rrd tool system
php-uuid - php uuid extension
php-memcache - memcache extension module for php
php-zmq - zeromq messaging bindings for php
php-igbinary - igbinary php serializer
php-msgpack - php extension for interfacing with messagepack
php-geoip - geoip module for php
php-tideways - tideways php profiler extension
php-yac - yac (yet another cache) for php
php-mailparse - email message manipulation for php
php-oauth - oauth 1.0 consumer and provider extension
php-gnupg - php wrapper around the gpgme library
php-propro - propro module for php
php-raphf - raphf module for php
php-solr - php extension for communicating with apache solr server
php-stomp - streaming text oriented messaging protocol (stomp) client module for php
php-gearman - php wrapper to libgearman
php-phalcon - full-stack php framework delivered as a c-extension
php-ds - php extension providing efficient data structures for php 7
php-sass - php bindings to libsass - fast, native sass parsing in php
php-lua - php embedded lua interpreter
libapache2-mod-php7.2 - server-side, html-embedded scripting language (apache 2 module)
libphp7.2-embed - html-embedded scripting language (embedded sapi library)
php7.2-bcmath - bcmath module for php
php7.2-bz2 - bzip2 module for php
php7.2-cgi - server-side, html-embedded scripting language (cgi binary)
php7.2-cli - command-line interpreter for the php scripting language
php7.2-common - documentation, examples and common module for php
php7.2-curl - curl module for php
php7.2-dba - dba module for php
php7.2-dev - files for php7.2 module development
php7.2-enchant - enchant module for php
php7.2-fpm - server-side, html-embedded scripting language (fpm-cgi binary)
php7.2-gd - gd module for php
php7.2-gmp - gmp module for php
php7.2-imap - imap module for php
php7.2-interbase - interbase module for php
php7.2-intl - internationalisation module for php
php7.2-json - json module for php
php7.2-ldap - ldap module for php
php7.2-mbstring - mbstring module for php
php7.2-mysql - mysql module for php
php7.2-odbc - odbc module for php
php7.2-opcache - zend opcache module for php
php7.2-pgsql - postgresql module for php
php7.2-phpdbg - server-side, html-embedded scripting language (phpdbg binary)
php7.2-pspell - pspell module for php
php7.2-readline - readline module for php
php7.2-recode - recode module for php
php7.2-snmp - snmp module for php
php7.2-soap - soap module for php
php7.2-sqlite3 - sqlite3 module for php
php7.2-sybase - sybase module for php
php7.2-tidy - tidy module for php
php7.2-xml - dom, simplexml, wddx, xml, and xsl module for php
php7.2-xmlrpc - xmlrpc-epi module for php
php7.2-zip - zip module for php
php7.2-xsl - xsl module for php (dummy)
php7.2 - server-side, html-embedded scripting language (metapackage)
php7.2-sodium - libsodium module for php5、选择安装 redis igbinary pear扩展php7后每个扩展都是一个独立的ini文件本次安装的php扩展都在/etc/php/7.2/mods-available下
apt install php-redis php-igbinary php-pear
ls /etc/php/7.2/mods-available
calendar.ini  fileinfo.ini  igbinary.ini  opcache.ini    readline.ini          
 sysvmsg.ini    xml.ini        zip.ini   ctype.ini     ftp.ini      
 json.ini      pdo.ini        redis.ini      
 sysvsem.ini    xmlreader.ini
 curl.ini      gd.ini        mbstring.ini  pdo_mysql.ini  shmop.ini      
 sysvshm.ini    xmlrpc.ini
 dom.ini       gettext.ini   mysqli.ini    phar.ini       simplexml.ini  
 tokenizer.ini  xmlwriter.ini
 exif.ini      iconv.ini     mysqlnd.ini   posix.ini      sockets.ini    
 wddx.ini       xsl.ini6、安装nghttp2库apt install nghttp2 libnghttp2-dev7、安装redis官方异步拓展hiredis,如报错需要增加系统gcc支持git clone https://github.com/redis/hire...
 cd hiredis
make -j
 如果报错 尝试安装gcc
 apt install gcc
 重新编译
 make -j
 make install
 ldconfig8、swoole拓展编译安装,不推荐使用pecl install swoolepecl的安装方式没有编译http2与hiredis支持gcc-4.4 或更高版本makeautoconfpcre (centos系统可以执行命令:yum install pcre-devel)
git clone https://gitee.com/swoole/swoo...
 cd swoole
 phpize
 ./configure  --enable-http2 --enable-async-redis
 make && make install9、添加swoole扩展到php环境中echo 'extension=swoole.so' >> /etc/php/7.2/mods-available/swoole.ini
cd /etc/php/7.2/cli/conf.d/ && ln -s ../../mods-available/swoole.ini 20-swoole.ini
cd /etc/php/7.2/fpm/conf.d/ && ln -s ../../mods-available/swoole.ini 20-swoole.ini10、查看是否引用成功php --ri swoole
swoole support => enabled
version => 2.1.2-alpha
author => tianfeng.han[email: mikan.tenny@gmail.com]
coroutine => enabled
epoll => enabled
eventfd => enabled
timerfd => enabled
signalfd => enabled
cpu affinity => enabled
spinlock => enabled
rwlock => enabled
async redis client => enabled
async http/websocket client => enabled
openssl => enabled
http2 => enabled
linux native aio => enabled
pcre => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enableddirective => local value => master value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => on => on
swoole.use_namespace => on => on
swoole.use_shortname => on => on
swoole.fast_serialize => off => off
swoole.unixsock_buffer_size => 8388608 => 8388608
至此完整全部完成
更多swoole技术文章,请访问swoole教程栏目!
以上就是swoole如何安装(全纪录分享)的详细内容。
其它类似信息

推荐信息