PHP安装
echo '+++++++++++++++++++++++++++++++' echo '' echo 'php5.5 install' echo '' echo '+++++++++++++++++++++++++++++++' user=$(whoami) cur_dir=$(pwd) read -p 'install php ?(y|n)' to_install case $to_install in y|Y) echo 'start install php...' ;; n|N) echo 'stop install php ......' exit 1 ;; *) echo 'input error' exit 1 ;; esac read -p 'install dir:' install_dir if [ -z "$install_dir" ]; then install_dir="/home/users/$user/local" fi bash -c "$( curl http://jumbo.baidu.com/install_jumbo.sh )"; source ~/.bashrc for package in cmake bison do jumbo install $package done lib_dir="$install_dir/lib1" mkdir -p $lib_dir cd $cur_dir tar -zxvf libiconv-1.14.tar.gz cd libiconv-1.14/ ./configure --prefix=$lib_dir/libiconv make && make install cd ../ tar -zxvf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-stable/ ./configure --prefix=$lib_dir/libevent make && make install cd ../ tar -zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8/ ./configure --prefix=$lib_dir/libmcrypt make && make install cd ../ tar -zxvf libpng-1.6.5.tar.gz cd libpng-1.6.5/ ./configure --prefix=$lib_dir/libpng make && make install cd ../ tar -zxvf libxml2-2.9.1.tar.gz cd libxml2-2.9.1/ ./configure --prefix=$lib_dir/libxml2 make && make install cd ../ tar -zxvf mhash-0.9.9.9.tar.gz cd mhash-0.9.9.9/ ./configure --prefix=$lib_dir/mhash make && make install cd ../ tar -zxvf readline-6.2.tar.gz cd readline-6.2/ ./configure --prefix=$lib_dir/readline make && make install cd ../ tar -zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8/ ./configure --prefix=$lib_dir/zlib make && make install cd ../ tar -zxvf openssl-1.0.1e.tar.gz cd openssl-1.0.1e/ ./config --prefix=$lib_dir/openssl make && make install cd ../ tar -zxvf libgd-2.1.0.tar.gz cd libgd-2.1.0/ ./configure --prefix=$lib_dir/gd2 make make install echo '++++++++++++++++++++++++++++++++++++++++++++++' echo '' echo '+++++++++++++++++php install++++++++++++++++++' cd $cur_dir tar -zxvf php-5.5.20.tar.gz cd php-5.5.20/ php_dir="$install_dir/php1" mkdir -p $php_dir ./configure --prefix=$php_dir \ --with-config-file-path=$php_dir/etc \ --with-mcrypt=$lib_dir/libmcrypt \ --with-openssl=$lib_dir/openssl \ --with-mhash=$lib_dir/mhash \ --with-iconv-dir=$lib_dir/libiconv \ --with-freetype-dir \ --with-zlib=$lib_dir/zlib \ --with-libxml-dir=$lib_dir/libxml2 \ --enable-xml \ --with-readline=$lib_dir/readline \ --enable-discard-path \ --enable-safe-mode \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --with-curlwrappers \ --enable-mbregex \ --enable-fpm \ --enable-mbstring \ --enable-gd-native-ttf \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --with-pear make make ZEND_EXTRA_LIBS= '-liconv' make install cp php.ini-production $php_dir/etc/php.ini mv $php_dir/etc/php-fpm.conf.default $php_dir/etc/php-fpm.conf echo '++++++++++++++++++++++++ php install end ++++++++++++++++++++++++++++++++++'
将shell和压缩的安装包放到同一个目录下,执行shell
如果安装包需要环境变量
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

浙公网安备 33010602011771号