文章来源:https://www.cnblogs.com/hello-tl/p/9404655.html
分享一个算是比较完美的php7.2yum安装
0.更换yum原
# yum install epel-release# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
1.安装php
# yum install php72w
2.安装php扩展根据自己需求来
php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml php72w php72w-bcmath php72w-dba php72w-enchant php72w-imap php72w-interbasephp72w-intl php72w-ldap ?php72w-mcrypt php72w-odbc php72w-pdo_dblib php72w-pear php72w-pecl-apcu php72w-pecl-imagick php72w-pecl-xdebug php72w-pgsql php72w-phpdbg php72w-process php72w-pspell php72w-recode php72w-snmp php72w-soap php72w-tidy php72w-xmlrpc php72w-pecl-igbinary php72w-intl php72w-memcached php72w-pecl-mongodb
3.查看php版本
[root@php ~]# php -vPHP 7.2.7 (cli) (built: Jul ?1 2018 08:22:47) ( NTS )Copyright (c) 1997-2018 The PHP GroupZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies ???with Zend OPcache v7.2.7, Copyright (c) 1999-2018, by Zend Technologies ???with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
4.配置文件所在地址
php.ini ????????????/etc/php.iniphp加载ini文件 ??????/etc/php.d/*.iniphp-fpm.conf ???????/etc/php-fpm.conf ???php-fpm.pid ????????/var/run/php-fpm/php-fpm.pidphp-fpm启动 ?????????php-fpm
5.扩展swoole
1)安装依赖包
# yum -y install postgresql-devel # yum install glibc-headers gcc-c++ git-core gcc autoconf cmake libcurl4-openssl-dev openssl libssl-dev build-essential zlibc zlib-bin libidn11-dev libidn11 minizip openssl-devel下载nghttp2依赖# wget nghttp2下载地址# tar -zxvf nghttp2# cd nghttp2# ./configure# make# make install下载hiredis依赖# wget hiredis下载地址# tar -zxvf hiredis# cd hiredis# make# make install
2)安装swoole
# pecl install swoole
3)根据自己的情况来选择yes or no 本次示范全部选为yes
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to updatedownloading swoole-4.0.3.tgz ...Starting to download swoole-4.0.3.tgz (903,874 bytes).........................................done: 903,874 bytes304 source files, buildingrunning: phpizeConfiguring for:PHP Api Version: ????????20170718Zend Module Api No: ?????20170718Zend Extension Api No: ??320170718enable debug/trace log support? [no] : yesenable sockets supports? [no] : yesenable openssl support? [no] : yesenable http2 support? [no] : yesenable async-redis support? [no] : yesenable mysqlnd support? [no] : yesenable postgresql coroutine client support? [no] :
4.安装完成
Build complete.Don‘t forget to run ‘make test‘.running: make INSTALL_ROOT="/var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3" installInstalling shared extensions: ????/var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/lib64/php/modules/Installing header files: ?????????/var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include/php/running: find "/var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3" | xargs ls -dils266121 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3266172 ????4 drwxr-xr-x 4 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr526626 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include526627 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include/php526628 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include/php/ext526629 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include/php/ext/swoole526631 ????8 -rw-r--r-- 1 root root ????4300 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include/php/ext/swoole/config.h526630 ????4 drwxr-xr-x 2 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/include/php/ext/swoole/include526623 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/lib64526624 ????4 drwxr-xr-x 3 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/lib64/php526625 ????4 drwxr-xr-x 2 root root ????4096 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/lib64/php/modules526622 12268 -rwxr-xr-x 1 root root 12560576 Aug ?1 23:00 /var/tmp/pear-build-rootPmvfF4/install-swoole-4.0.3/usr/lib64/php/modules/swoole.soBuild process completed successfullyInstalling ‘/usr/lib64/php/modules/swoole.so‘Installing ‘/usr/include/php/ext/swoole/config.h‘install ok: channel://pecl.php.net/swoole-4.0.3configuration option "php_ini" is not set to php.ini locationYou should add "extension=swoole.so" to php.ini
5.加入swoole.so加入ini
在 /etc/php.d/下新建并并写入# vim /etc/php.d/swoole.ini ???; Enable swoole extension module ???extension=swoole.so:wq
6.查看php扩展
[PHP Modules]apcubcmathbz2calendarCorectypecurldatedbadomenchantexiffileinfofilterftpgdgettextgmphashiconvigbinaryimagickimapintljsonldaplibxmlmbstringmemcachedmongodbmysqlimysqlndodbcopensslpcntlpcrePDOpdo_dblibpdo_mysqlPDO_ODBCpdo_pgsqlpdo_sqlitepgsqlPharposixpspellreadlinerecoderedisReflectionsessionshmopSimpleXMLsnmpsoapsocketsSPLsqlite3standardswoolesysvmsgsysvsemsysvshmtidytokenizerwddxxdebugxmlxmlreaderxmlrpcxmlwriterxslZend OPcachezipzlib[Zend Modules]XdebugZend OPcache
文章来源:https://www.cnblogs.com/hello-tl/p/9404655.html
yum安装php7.2
原文地址:https://www.cnblogs.com/hello-tl/p/9404655.html