- A+
所属分类:应用运维
1 | yum install libxml2-devel curl-devel openjpeg openjpeg-devel openjpeg-libs libjpeg libpng freetype libjpeg libpng-devel freetype-devel mcrypt php-mcrypt libmcrypt libmcrypt-devel |
1.创建php用户和用户组:
1 | groupadd -r php && useradd -r -g php -s /bin/flase -M /usr/local/php7 |
1 | ./configure --prefix=/usr/local/php7 --exec-prefix=/usr/local/php7 --bindir=/usr/local/php7/bin --sbindir=/usr/local/php7/sbin --includedir=/usr/local/php7/include --libdir=/usr/local/php7/lib/php --mandir=/usr/local/php7/php/man --with-config-file-path=/usr/local/php7/etc --with-mysql-sock=/var/run/mysql/mysql.sock --with-mcrypt=/usr/include --with-mhash --with-openssl --with-zlib --enable-zip --enable-mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --without-gdbm --disable-fileinfo --with-bz2 --enable-maintainer-zts |
1 | ./configure --prefix=/application/php-7.2 --exec-prefix=/application/php-7.2 --bindir=/application/php-7.2/bin --sbindir=/application/php-7.2/sbin --includedir=/application/php-7.2/include --libdir=/application/php-7.2/lib/php --mandir=/application/php-7.2/php/man --with-config-file-path=/application/php-7.2/etc --with-mhash --with-openssl --with-zlib --enable-zip --enable-mysqlnd --with-mysqli=shared,mysqlnd --with-pdo-mysql=shared,mysqlnd --with-gd --with-iconv --with-zlib --enable-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-ftp --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --enable-fpm --with-fpm-user=apache --with-fpm-group=apache --without-gdbm --disable-fileinfo --with-bz2 --enable-maintainer-zts |
3.配置文件的服务控制脚本
配置文件:
1 2 | cp /php.7/php.ini-production /usr/local/php7/etc/php.ini cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf |
服务控制脚本:
1 | cp /php.7/sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm && chown +x php-fpm |
4.设置php日志文件目录和运行ID文件目录,修改session目录配置
1 2 3 | mkdir -p /var/log/php-fpm/ && mkdir -p /var/run/php-fpm && cd /var/run/ && chown -R apache:apache php-fpm mkdir -p /var/lib/php/session chown -R apache:apache /var/lib/php |
5.加入环境变量
1 2 3 | vim /etc/profile.d/php7.sh export PATH=/usr/local/php7/bin:/usr/local/php7/sbin:$PATH ./configure --prefix=/application/php-7.0.21 --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-gd --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=jws --with-fpm-group=jws --enable-ftp --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm --with-iconv=/usr/local/libiconv --with-webp-dir=/usr --with-xpm-dir=/usr |

我的微信公众号
我的微信公众号扫一扫