修改bug

This commit is contained in:
root 2019-05-22 11:42:34 +08:00
parent 9827362d16
commit 25fff6d121
4 changed files with 42 additions and 34 deletions

View File

@ -40,15 +40,6 @@ function install_php() {
if [ `rpm -qa|grep libxml2-devel|wc -l` == 0 ];then
yum -y install libxml2-devel
fi
if [ `rpm -qa|grep libjpeg-turbo-devel|wc -l` == 0 ];then
yum -y install libjpeg-turbo-devel
fi
if [ `rpm -qa|grep libpng-devel|wc -l` == 0 ];then
yum -y install libpng-devel
fi
if [ `rpm -qa|grep freetype-devel|wc -l` == 0 ];then
yum -y install freetype-devel
fi
}
# 扩展需要的函数
@ -86,6 +77,20 @@ function install_extension() {
yum -y install ImageMagick-devel
fi
;;
gd)
if [ `rpm -qa|grep gd-devel|wc -l` == 0 ];then
yum -y install gd-devel
fi
if [ `rpm -qa|grep libjpeg-turbo-devel|wc -l` == 0 ];then
yum -y install libjpeg-turbo-devel
fi
if [ `rpm -qa|grep libpng-devel|wc -l` == 0 ];then
yum -y install libpng-devel
fi
if [ `rpm -qa|grep freetype-devel|wc -l` == 0 ];then
yum -y install freetype-devel
fi
;;
*)
grep_file=$1'-devel'
if [ `echo $1|grep pdo_|wc -l` != 0 ];then

View File

@ -19,7 +19,7 @@ php_file_dir=`get_file_dir $php_file_name`
php='/usr/local/'$php_file_dir'/bin/php'
phpize='/usr/local/'$php_file_dir'/bin/phpize'
php_config='/usr/local/'$php_file_dir'/bin/php-config'
php_ini='/usr/local/'$php_file_dir'/etc/php.ini'
php_conf_d='/usr/local/'$php_file_dir'/etc/conf.d'
pecl='/usr/local/'$php_file_dir'/bin/pecl'
if [ 'a'$1 == 'a' ];then
@ -39,6 +39,7 @@ case $extension in
cd $libmcrypt_dir
./configure --prefix=/usr/local/libmcrypt
make -j$thread && make install
cd $PWD
if [ $? != 0 ];then
echo 'libmcrypt安装失败'
exit 1
@ -46,12 +47,23 @@ case $extension in
fi
;;
esac
if [ `$php -m|grep $extension|wc -l` == 0 ];then
ext_dir=$PWD'/package/'$php_file_dir'/ext'
extension_dir=$ext_dir'/'$extension
install_extension $extension
if [ ! -d $extension_dir ];then
case $extension in
mcrypt)
mcrypt_package=`get_config lib mcrypt_package`
mcrypt_package=`exists_download $mcrypt_package`
mcrypt_dir=`get_file_dir $mcrypt_package`
decompression $mcrypt_package
cp -R $mcrypt_dir $extension_dir
;;
*)
;;
esac
fi
if [ ! -d $extension_dir ];then
$pecl install $extension
pecl_error=$?
@ -86,6 +98,9 @@ if [ `$php -m|grep $extension|wc -l` == 0 ];then
mcrypt)
./configure --with-php-config=$php_config --with-mcrypt=/usr/local/libmcrypt
;;
gd)
./configure --with-php-config=$php_config --with-jpeg-dir --with-freetype-dir --with-png-dir
;;
*)
./configure --with-php-config=$php_config
;;
@ -96,9 +111,11 @@ if [ `$php -m|grep $extension|wc -l` == 0 ];then
fi
fi
# 配置文件是否配置
file_extension_num=`cat $php_ini|grep $extension'.so'|wc -l`
if [ ! -d $php_conf_d ];then
mkdir -p $php_conf_d
fi
dir_extension_num=`find '/usr/local/'$php_file_dir'/lib/php' -name $extension'.so'|wc -l`
if [ $file_extension_num == 0 ] && [ $dir_extension_num != 0 ];then
echo 'extension='$extension'.so' >> $php_ini
if [ ! -f $php_conf_d'/'$extension'.ini' ] && [ $dir_extension_num != 0 ];then
echo 'extension='$extension'.so' >> $php_conf_d'/'$extension'.ini'
fi
fi

View File

@ -13,7 +13,6 @@ install_php
# 获取配置
thread=`get_config core thread`
package=`get_config php package`
libmcrypt_package=`get_config lib libmcrypt_package`
server_type=`get_config server type`
apache_package=`get_config server apache_package`
nginx_package=`get_config server nginx_package`
@ -29,20 +28,6 @@ fi
# 下载地址
package=`exists_download $package`
libmcrypt_package=`exists_download $libmcrypt_package`
# 安装libmcrypt
if [ ! -d '/usr/local/libmcrypt' ];then
decompression $libmcrypt_package
libmcrypt_dir=`get_file_dir $libmcrypt_package`
cd $libmcrypt_dir
./configure --prefix=/usr/local/libmcrypt
make -j$thread && make install
if [ $? != 0 ];then
echo 'libmcrypt安装失败'
exit 1
fi
fi
# 安装php
@ -55,7 +40,7 @@ case $server_type in
apache_file_name=`get_path_name $apache_package`
apache_file_dir=`get_file_dir $apache_file_name`
apxs_path='/usr/local/'$apache_file_dir'/bin/apxs'
./configure --prefix=$path_dir --with-apxs2=$apxs_path --with-config-file-path=$path_dir/etc --enable-soap --with-jpeg-dir --with-freetype-dir --with-png-dir
./configure --prefix=$path_dir --with-apxs2=$apxs_path --with-config-file-path=$path_dir/etc --with-config-file-scan-dir=$path_dir/etc/conf.d --enable-soap --with-mhash
make -j$thread && make install
error=$?
if [ $error == 0 ];then
@ -77,7 +62,7 @@ case $server_type in
nginx)
nginx_file_name=`get_path_name $nginx_package`
nginx_file_dir=`get_file_dir $nginx_file_name`
./configure --prefix=$path_dir --with-config-file-path=$path_dir/etc --enable-fastcgi --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-soap --enable-opcache=no --with-jpeg-dir --with-freetype-dir --with-png-dir
./configure --prefix=$path_dir --with-config-file-path=$path_dir/etc --with-config-file-scan-dir=$path_dir/etc/conf.d --enable-fastcgi --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-soap --enable-opcache=no --with-mhash
make -j$thread && make install
error=$?
if [ $error == 0 ];then

View File

@ -6,12 +6,13 @@ apache_package=http://www.apache.org/dist/httpd/httpd-2.4.39.tar.bz2
type=mysql
package=http://mirrors.163.com/mysql/Downloads/MySQL-5.5/mysql-5.5.61.tar.gz
[php]
package=https://www.php.net/distributions/php-7.1.29.tar.bz2
php_extension=bcmath,ctype,curl,filter,gd,iconv,imagick,libxml,mbstring,openssl,pdo_pgsql,redis,session,sockets,amqp
package=https://www.php.net/distributions/php-7.2.18.tar.bz2
php_extension=openssl,zlib,mbstring,bz2,gd,pdo_pgsql,mcrypt,imagick,redis,amqp
[lib]
apr_package=http://www.apache.org/dist/apr/apr-1.7.0.tar.bz2
apr_util_package=http://www.apache.org/dist/apr/apr-util-1.6.1.tar.bz2
pcre_package=http://ftp.pcre.org/pub/pcre/pcre-8.43.tar.bz2
libmcrypt_package=https://sourceforge.mirrorservice.org/m/mc/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
mcrypt_package=http://pecl.php.net/get/mcrypt-1.0.1.tgz
[core]
thread=4