Home > Backend Development > PHP Tutorial > php5.3.10 automated deployment script first version_PHP tutorial

php5.3.10 automated deployment script first version_PHP tutorial

WBOY
Release: 2016-07-13 17:48:46
Original
1265 people have browsed it

Completed the first phase of deployment of php5.3.10, and then made a summary, writing the deployment of php as a shell script automatically, which will facilitate the gradual expansion in the future, and practice the shell script learned before

Environment:
----------------------------
System | CentOS-5.7
----------------------------

The script is as follows:
[plain]
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to install php"
exit 1
fi

clear
echo "================================================ ========================="
echo "PHP install shell script for CentOS/RadHat Written by Qzi"
echo "================================================ ========================="
echo "================================================ ========================="
echo "PHP Version: 5.3.10"
echo "================================================ ========================="
cur_dir=$(pwd)

rpm -qa|grep php
rpm -e php

echo "================================================ ========================="
echo "install dependences"
echo "================================================ ========================="

#for packages in patch make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib -devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel vim-minimal nano fonts-chinese gettext gettext-devel ncurses -devel gmp-devel pspell-devel unzip autoconf;
#do yum -y install $packages; done

echo "============================check files================== ================"

if [ -s php-5.3.10.tar.gz ]; then
echo "php-5.3.10.tar.gz [found]"
else
echo "Error: php-5.3.10.tar.gz not found!!!download now..."
wget -c wget http://www.php.net/get/php-5.3.10.tar.gz/from/us.php.net/mirror
fi

if [ -s libiconv-1.14.tar.gz ]; then
echo "libiconv-1.14.tar.gz [found]"
else
echo "Error: libiconv-1.14.tar.gz not found!!!download now..."
wget -c http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
fi

echo "============================check files================== ================"
echo "============================php install================== ================"

cd $cur_dir

tar -zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/opt/php/3rdlibs/libiconv-1.14/
make ZEND_EXTRA_LIBS = -liconv
make && make install
ls /opt/php/3rdlibs/libiconv-1.14/
cd ../

tar -zxvf php-5.3.10.tar.gz
cd php-5.3.10
./configure
--prefix=/opt/php
--with-config-file-path=/opt/php/etc
--with-iconv-dir=/opt/php/3rdlibs/libiconv-1.14
--with-pgsql=/opt/pgsql
--enable-fpm
make && make install
cd ../

#echo "============================php complete================== ================"
#exit 0

The dependency part is a bit overdone. It is to prepare for nginx and database. There are also few PHP extensions, but I don’t want to add them for the time being. I will add them when I learn more...

A php group has been established, welcome to learn together (QQ group number: 213572677)

Enjoy it!


Excerpted from GameRoler

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478405.htmlTechArticleCompleted the first phase of deployment of php5.3.10, and then made a summary and wrote the deployment of php as shell script is automatic and will help you expand slowly in the future and practice the sh you learned before...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template