Php5.3.10 automated deployment script first version _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Php5.3.10 the first version of the automated deployment script. After completing the deployment in the first phase of php5.3.10, I made a summary and wrote the php deployment as shellscript automatically, which will facilitate the subsequent expansion, practice sh to complete the deployment in the first phase of php5.3.10, and then make a summary to write the php deployment into shell script automatically, which will facilitate the subsequent expansion, and practice the shell script we learned earlier.

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-c ++ gcc-g77 flex bison file libtool-libs autoconf kernel-devel libjpeg-devel libpng-devel libpng10 libpng10-devel gd-devel freetype -devel libxml2 libxml2-devel zlib-devel glib2 glib2-devel bzip2 bzip2-devel kernel-devel ncurses-devel curl-devel kernel e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel vim-minimal nano fonts-chinese 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 ......"
Http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz wget-c
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/3 rdlibs/libiconv-1.14/
Make ZEND_EXTRA_LIBS =-liconv
Make & make install
Ls/opt/php/3 rdlibs/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/3 rdlibs/libiconv-1.14 \
-- With-pgsql =/opt/pgsql \
-- Enable-fpm
Make & make install
Cd ../

# Echo "============================== php complete ======== ====================================="
# Exit 0

The dependency part is a bit too much. it is prepared for nginx and the database, and there are few php extensions, but I don't want to add them now. I want to learn which one to add...

We have established a php Group. welcome to join us (qq group No.: 213572677)

Enjoy it!


From GameRoler

The slave script is automatic and will be easy to expand in the future, and practice the sh...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.