swoole安装的方法
这篇文章主要介绍了swoole安装的方法的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇swoole安装的方法文章都会有所收获,下面我们一起来看看吧。
10年积累的成都做网站、网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站策划后付款的网站建设流程,更有中方免费网站建设让你可以放心的选择与我们合作。
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-certificates
2、添加PHP PPA 源 并更新缓存
add-apt-repository ppa:ondrej/php & apt update
3、安装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 -y
4、查看当前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-ssh3 - Bindings for the libssh3 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 PHP
5、选择安装 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.ini
6、安装nghttp2库
apt install nghttp2 libnghttp2-dev
7、安装redis官方异步拓展hiredis,如报错需要增加系统gcc支持
git clone https://github.com/redis/hire...
cd hiredis
make -j
如果报错 尝试安装gcc
apt install gcc
重新编译
make -j
make install
ldconfig
8、swoole拓展编译安装,不推荐使用pecl install swoole
pecl的安装方式没有编译http2与hiredis支持 gcc-4.4 或更高版本 make autoconf pcre (centos系统可以执行命令:yum install pcre-devel)
git clone https://gitee.com/swoole/swoo...
cd swoole
phpize
./configure --enable-http2 --enable-async-redis
make && make install
9、添加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.ini
10、查看是否引用成功
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安装的方法
标题路径:http://pwwzsj.com/article/peciss.html