useradd -r -s /sbin/nologin php-fpm下载解压安装包
cd /data/pkgwget http://php.net/get/php-7.2.2.tar.gz/from/this/mirror mv mirror php-7.2.2.tar.gztar zxvf php-7.2.2.tar.gzcd php-7.2.2安装依赖
yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt libicu-devel libxslt-devel编译安装
./configure /--prefix=/usr/local/php-7.2.2 /--with-mhash /--with-openssl /--with-config-file-path=/usr/local/php-7.2.2/etc /--disable-short-tags /--enable-fpm /--with-fpm-user=php-fpm --with-fpm-group=php-fpm /--enable-xml /--with-libxml-dir /--enable-bcmath /--enable-calendar /--enable-intl /--enable-mbstring /--enable-pcntl /--enable-shmop /--enable-soap /--enable-sockets /--enable-zip /--enable-mbregex /--enable-mysqlnd /--enable-mysqlnd-compression-support /--with-mysqli=mysqlnd /--with-pdo-mysql=mysqlnd /--with-gd /--enable-ftp /--with-curl /--with-xsl /--with-iconv /--with-freetype-dir /--with-jpeg-dir /--with-png-dir /--with-zlib /--enable-sysvsem /--enable-inline-optimization /--with-xmlrpc /--with-gettextmake -j 4 make install建立软链
ln -s /usr/local/php-7.2.2/ /usr/local/phpln -s /usr/local/php/bin/php /usr/local/binln -s /usr/local/php/sbin/php-fpm /usr/local/sbin对php-fpm运行用户进行设置
cd /data/pkg/php-7.2.2cp ./php.ini-development ./php.ini-production /usr/local/php/etccp /usr/local/php/etc/php.ini-development /usr/local/php/etc/php.inicp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.confcp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf建立软链
ln -s /usr/local/php/etc/php.ini /usr/local/etc/ln -s /usr/local/php/etc/php-fpm.conf /usr/local/etc/ln -s /usr/local/php/etc/php-fpm.d/www.conf /usr/local/etc/配置html' target='_blank'>环境变量,加入全局命令
vim /etc/profilePATH=$PATH:/usr/local/php/binexport PATHsource /etc/profile启动php-fpm 服务
/usr/local/sbin/php-fpm查看是否启动
netstat -lnt | grep 9000杀死php-fpm
killall php-fpm
以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP !
相关推荐:
linux编译安装mysql5.7
PHP7.2 Data Structures的使用
以上就是linux编译安装php7.2的详细内容,PHP教程
郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。
新闻热点
疑难解答