fpm就是这么简单
时间:2022-10-10 15:43 来源:网络整理 作者:采集插件 点击:次
能用脚本做的事情就不一条条敲命令了。 centos7安装php 如果需要不同版本的php,只需要修改一下版本号就可以了。既然在centos7上安装了,就使用systemd去管理服务吧! 代码: #!/bin/bash version="7.1.15" url="http://cn2.php.net/distributions/php-${version}.tar.bz2" #downloadpackage wget-c$url #checkpackage SOURCE_PACKAGE="php-${version}.tar.bz2" if[!-f"$SOURCE_PACKAGE"] then echo"packagenofound" exit1 fi tar-jxf$SOURCE_PACKAGE if["$?"!="0"] then echo"extrapackagefail" exit2 fi #installdeps yuminstalllibjpeglibjpeg-develcurl-develgccgcc-c++libxml2-developensslopenssl-devellibpng-develfreetype-devellibmcryptlibmcrypt-devel-y then echo"installdepsfail" exit3 fi cdphp-$version ./configure--prefix=/opt/php7--with-config-file-path=/opt/php7/etc--with-config-file-scan-dir=/opt/php7/etc/php.d--with-mcrypt=/usr/include--enable-mysqlnd--with-mysqli--with-pdo-mysql--enable-fpm--with-fpm-user=nginx--with-fpm-group=nginx--with-gd--with-iconv--with-zlib--enable-xml--enable-shmop--enable-sysvsem--enable-inline-optimization--enable-mbregex--enable-mbstring--enable-ftp--enable-gd-native-ttf--with-openssl--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--without-pear--with-gettext--enable-session--with-curl--with-jpeg-dir--with-freetype-dir--enable-opcache--with-mhash then echo"configphpfail" exit4 fi make&&makeinstall then echo"installphpfail" exit5 fi cp./sapi/fpm/php-fpm.service/usr/lib/systemd/system/ cp./php.ini-development/opt/php7/etc/php.ini cp/opt/php7/etc/php-fpm.conf.default/opt/php7/etc/php-fpm.conf cp/opt/php7/etc/php-fpm.d/www.conf.default/opt/php7/etc/php-fpm.d/www.conf systemctldaemon-reload systemctlenablephp-fpm systemctlstartphp-fpm 总结 这个脚本安装都是默认的配置,需要什么配置,自己修改一下配置就可以了。 (责任编辑:admin) |
- 上一篇:疫情下香港青年:各司其职 协助抗疫
- 下一篇:新冠肺炎疫情将引发全球经济衰退?