php编译成jphp,php编译脚本安装

#!/bin/bash

# File Name: phpInstall.sh

# Author: hanye131

# Email: hz7726@163.com

# Version:

# Created Time:

phpuser=$1

phpversion=$2

phpdata=/data/soft

phpinstall=/usr/local/php

if [ "$#" -lt "2" ]; then

echo "传递参数为2个: 第一个为php的运行用户,第二个是版本"

exit 1

else

groupadd -r -g 500 $phpuser && useradd -u 500 -g 500 -s /sbin/nologin -M $phpuser

cd $phpdata && wget https://www.php.net/distributions/php-${phpversion}.tar.gz

echo “php-${phpversion}.tar.gz 下载完毕”

echo -e

yum install -y gcc autoconf gcc-c++ make

yum install -y libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel readline readline-devel libxslt libxslt-devel

yum install -y systemd-devel openjpeg-devel curl-devel libzip-devel

wget https://nih.at/libzip/libzip-1.2.0.tar.gz

tar xf libzip-1.2.0.tar.gz

cd libzip-1.2.0

./configure

make -j 6 && make install

tar xf php-${phpversion}.tar.gz

cd php-${phpversion}

./configure'

--prefix=${phpinstall}

--with-config-file-path=${phpinstall}/etc

--with-config-file-scan-dir=${phpinstall}/etc/php.d

--with-fpm-user=$phpuser

--with-fpm-group=$phpuser

--enable-fpm

--enable-opcache

--disable-fileinfo

--enable-mysqlnd

--with-mysqli=mysqlnd

--with-pdo-mysql=mysqlnd

--with-iconv-dir=/usr/local

--with-freetype-dir

--with-jpeg-dir

--with-png-dir

--with-zlib

--with-libxml-dir=/usr

--enable-xml

--disable-rpath

--enable-bcmath

--enable-shmop

--enable-exif

--enable-sysvsem

--enable-inline-optimization

--with-curl=/usr/local

--enable-mbregex

--enable-mbstring

--with-mcrypt

--with-gd

--enable-gd-native-ttf

--with-openssl

--with-mhash

--enable-pcntl

--enable-sockets

--with-xmlrpc

--enable-ftp

--enable-intl

--with-xsl

--with-gettext

--enable-zip

--enable-soap

--disable-debug

make -j 6 && make install

cp php.ini-production ${phpinstall}/etc/php.ini

cp ${phpinstall}/etc/php-fpm.conf.default ${phpinstall}/etc/php-fpm.conf

echo "PATH=/usr/local/php/sbin:$PATH" >>/etc/profile

cat > ${installPath}/etc/php-fpm.conf << EOF

[global]

pid = run/php-fpm.pid

error_log = log/php-fpm.log

log_level = warning

emergency_restart_threshold = 30

emergency_restart_interval = 60s

process_control_timeout = 5s

daemonize = yes

[qa]

listen = /dev/shm/php-fastcgi.sock

listen.backlog = -1

listen.allowed_clients = 127.0.0.1

listen.owner = $phpuser

listen.group = $phpuser

listen.mode = 0666

user = qa

group = qa

pm = dynamic

pm.max_children = 30

pm.start_servers = 10

pm.min_spare_servers = 10

pm.max_spare_servers = 30

pm.max_requests = 1000

pm.process_idle_timeout = 20s

request_terminate_timeout = 200

request_slowlog_timeout = 5

pm.status_path = /php-fpm_status

slowlog = log/slow.log

rlimit_files = 51200

rlimit_core = 0

catch_workers_output = no

;env[HOSTNAME] = iZ2zeb1kcfbotalsu02k64Z

env[PATH] = /usr/local/bin:/usr/bin:/bin

env[TMP] = /tmp

env[TMPDIR] = /tmp

env[TEMP] = /tmp

EOF

cp ${phpdata}/php-${phpversion}/sapi/fpm/php-fpm.service /usr/lib/systemd/system/

systemctl daemon-reload&&systemctl enable php-fpm

systemctl start php-fpm

fi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值