登录  | 加入社区

黑狼游客您好!登录后享受更多精彩

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

查看: 654|回复: 0

linux-centos7安装php-fpm就是这么简朴

[复制链接]

179

主题

179

帖子

0

现金

黑狼菜鸟

Rank: 1

积分
0
发表于 2019-2-10 23:04:10 | 显示全部楼层 |阅读模式 来自 江苏徐州
媒介
能用脚本做的事变就不一条条敲下令了。


agO54oj57o7G7FAg.jpg

centos7安装php
假如必要差别版本的php,只必要修改一下版本号就可以了。既然在centos7上安装了,就利用systemd去管理服务吧!
代码:
#!/bin/bash
version="7.1.15"
url="http://cn2.php.net/distributions/php-${version}.tar.bz2"
# download package
wget -c $url
# check package
SOURCE_PACKAGE="php-${version}.tar.bz2"
if [ ! -f "$SOURCE_PACKAGE" ]
then
echo "package no found "
exit 1
fi
tar -jxf $SOURCE_PACKAGE
if [ "$?" != "0" ]
then
echo "extra package fail "
exit 2
fi
# install deps
yum install libjpeg libjpeg-devel curl-devel gcc gcc-c++ libxml2-devel openssl openssl-devel libpng-devel freetype-devel libmcrypt libmcrypt-devel -y
if [ "$?" != "0" ]
then
echo "install deps fail "
exit 3
fi
cd php-$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
if [ "$?" != "0" ]
then
echo "config php fail "
exit 4
fi
make && make install
if [ "$?" != "0" ]
then
echo "install php fail "
exit 5
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
systemctl daemon-reload
systemctl enable php-fpm
systemctl start php-fpm

总结
这个脚本安装都是默认的设置,必要什么设置,本身修改一下设置就可以了。




上一篇:条记:Centos7历程与用户相干管理,pstopwhoptree
下一篇:Nginx+Tomcat+memcached高可用会话保持,看不看你决定!
您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

 

QQ|申请友链|小黑屋|手机版|Hlshell Inc. ( 豫ICP备16002110号-5 )

GMT+8, 2024-5-8 14:17 , Processed in 0.078896 second(s), 47 queries .

HLShell有权修改版权声明内容,如有任何爭議,HLShell將保留最終決定權!

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表