编译安装php5.5.7 脚本

#!/bin/bash
rm -rf php-5.5.7
if [ ! -f php-5.5.7.tar.gz ];then
  wget http://oss.aliyuncs.com/aliyunecs/onekey/php/php-5.5.7.tar.gz
fi
tar zxvf php-5.5.7.tar.gz
cd php-5.5.7
./configure --prefix=/alidata/server/php --enable-opcache --with-config-file-path=/alidata/server/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --enable-fastcgi --enable-static --enable-inline-optimization --enable-sockets --enable-wddx --enable-zip --enable-calendar --enable-bcmath --enable-soap --with-zlib --with-iconv --with-gd --with-xmlrpc --enable-mbstring --without-sqlite --with-curl --enable-ftp --with-mcrypt  --with-freetype-dir=/usr/local/freetype.2.1.10 --with-jpeg-dir=/usr/local/jpeg.6 --with-png-dir=/usr/local/libpng.1.2.50 --disable-ipv6 --disable-debug --with-openssl --disable-maintainer-zts --disable-safe-mode --disable-fileinfo

CPU_NUM=$(cat /proc/cpuinfo | grep processor | wc -l)
if [ $CPU_NUM -gt 1 ];then
    make ZEND_EXTRA_LIBS=‘-liconv‘ -j$CPU_NUM
else
    make ZEND_EXTRA_LIBS=‘-liconv‘
fi
make install
cd ..
cp ./php-5.5.32/php.ini-production /alidata/server/php/etc/php.ini
#adjust php.ini
sed -i ‘s#; extension_dir = \"\.\/\"#extension_dir = "/alidata/server/php/lib/php/extensions/no-debug-non-zts-20121212/"#‘  /alidata/server/php/etc/php.ini
sed -i ‘s/post_max_size = 8M/post_max_size = 64M/g‘ /alidata/server/php/etc/php.ini
sed -i ‘s/upload_max_filesize = 2M/upload_max_filesize = 64M/g‘ /alidata/server/php/etc/php.ini
sed -i ‘s/;date.timezone =/date.timezone = PRC/g‘ /alidata/server/php/etc/php.ini
sed -i ‘s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=1/g‘ /alidata/server/php/etc/php.ini
sed -i ‘s/max_execution_time = 30/max_execution_time = 300/g‘ /alidata/server/php/etc/php.ini
#adjust php-fpm
cp /alidata/server/php/etc/php-fpm.conf.default /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,user = nobody,user=www,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,group = nobody,group=www,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,^pm.min_spare_servers = 1,pm.min_spare_servers = 5,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,^pm.max_spare_servers = 3,pm.max_spare_servers = 35,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,^pm.max_children = 5,pm.max_children = 100,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,^pm.start_servers = 2,pm.start_servers = 20,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,;pid = run/php-fpm.pid,pid = run/php-fpm.pid,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,;error_log = log/php-fpm.log,error_log = /alidata/log/php/php-fpm.log,g‘   /alidata/server/php/etc/php-fpm.conf
sed -i ‘s,;slowlog = log/$pool.log.slow,slowlog = /alidata/log/php/\$pool.log.slow,g‘   /alidata/server/php/etc/php-fpm.conf
#self start
install -v -m755 ./php-5.5.7/sapi/fpm/init.d.php-fpm  /etc/init.d/php-fpm
/etc/init.d/php-fpm start

以上为5.5.7的编译脚本,5.5.32也通用(亲测)。

来自为知笔记(Wiz)

时间: 2024-11-05 14:59:37

编译安装php5.5.7 脚本的相关文章

二、Ubuntu下编译安装PHP5.6.16

    在Ubuntu下搭建LNMP环境.编译安装mysql,nginx,php.最后在LNMP前提下安装composer,并且安装laravel框架.首先,第三步开始编译安装PHP5.6.16 1.先进入"/usr/local/src"文件夹中,接着键入 "sudo wget http://cn2.php.net/distributions/php-5.6.16.tar.gz"回车,等待下载完毕.下载完毕后,执行"sudo tar zxvf php-5.

三、Ubuntu下编译安装PHP5.6.16

    在Ubuntu下搭建LNMP环境.编译安装mysql,nginx,php.最后在LNMP前提下安装composer,并且安装laravel框架.首先,第三步开始编译安装PHP5.6.16 1.先进入"/usr/local/src"文件夹中,接着键入 "sudo wget http://cn2.php.net/distributions/php-5.6.16.tar.gz"回车,等待下载完毕.下载完毕后,执行"sudo tar zxvf php-5.

我的linux学习之旅: (3)编译安装php5.4

编译安装php5.4 目标:编译完成php5.4,并安装xcache.配合http2.4实现一个虚拟主机 操作系统CentOS6.6 x32_64 安装中使用的文件 /etc/sysconfig/network-scripts/ifcfg-eth0 配置 开始编译安装 安装完毕启动服务 按惯例上脚本php.sh #!/bin/bash php=php-5.4.31 xcache=xcache-3.1.0 # 本机IP ip=172.16.32.231 # php安装路径 path=/usr/lo

编译安装php5.6.12

一.系统环境说明 本次实验基于CentOS6.8_x64 (6.x均可),编译安装php5.6.12 包含以下四个扩展模块(包): libmcrypt-2.5.8.tar.gz ;php-redis.tar.gz;jpegsrc.v8d.tar.gz ;zendopcache-7.0.5.tar.gz 可自行到对应官方网站 下载最新软件包,本例软件包版本如上所列,如需要本例软件压缩包php5.6.12.tar.gz请到以下百度网盘地址中获取 ,压缩包中包含以上安装包,并附自动安装脚本和php-f

三、编译安装php-5.5.34

1.解决依赖关系 安装依赖包: # yum -y groupinstall"Desktop Platform Development" # yum install gcc make gd-devellibjpeg-devel libjpeg-turbo-devel libpng-devel libxml2-devel bzip2-devellibcurl-devel libiconv-devel libevent libevent-devel zlib-devel -y # yumin

基于CentOS6.5环境之下的LNMP之编译安装PHP5.5.30

LNMP之编译安装PHP5.5.30 1.编译前操作: 1.1.netstat -tulnp | egrep "80|3306" tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      25392/nginx          tcp        0      0 :::3306                     :::*                   

编译安装php-5.4.40

编译安装php-5.4.40 场景一:php编译为httpd的模块: 编译安装httpd-2.4: apr,apr-util httpd-2.4 mariadb-5.5.42 注意:不用使用5.5.40除非自己去打补丁;与php结合会有问题; 安装php: 额外安装:libxml2-devel, libmcrypt-devel, bzip-devel 方法一: 我挂载的是CentOS-6.6-x86_64-bin-DVD1 这个安装光盘: # mount /dev/cdrom /media # 

四、编译安装php-5.5.34

四.编译安装php-5.5.34 http://cn2.php.net/distributions/php-5.5.34.tar.gz 1.解决依赖关系 先配置阿里云yum源: 1.备份 # mv/etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup   2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/ CentOS 6: # wget-O /etc/yum.repos

编译安装LAMP(三)——编译安装php-5.4.13

1.解决依赖关系:如果想让编译的php支持mcrypt扩展,需要下载如下两个rpm包并安装之:libmcrypt-2.5.7-5.el5.i386.rpmlibmcrypt-devel-2.5.7-5.el5.i386.rpm 注:www.rpmfind.net 2.编译安装php-5.4.13首先下载源码包至本地目录,下载位置ftp://172.16.0.1/pub/Sources/new_lamp. # tar xf php-5.4.13.tar.bz2 # cd php-5.4.13 #