修改bug
This commit is contained in:
parent
9827362d16
commit
25fff6d121
@ -40,15 +40,6 @@ function install_php() {
|
|||||||
if [ `rpm -qa|grep libxml2-devel|wc -l` == 0 ];then
|
if [ `rpm -qa|grep libxml2-devel|wc -l` == 0 ];then
|
||||||
yum -y install libxml2-devel
|
yum -y install libxml2-devel
|
||||||
fi
|
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
|
yum -y install ImageMagick-devel
|
||||||
fi
|
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'
|
grep_file=$1'-devel'
|
||||||
if [ `echo $1|grep pdo_|wc -l` != 0 ];then
|
if [ `echo $1|grep pdo_|wc -l` != 0 ];then
|
||||||
|
|||||||
@ -19,7 +19,7 @@ php_file_dir=`get_file_dir $php_file_name`
|
|||||||
php='/usr/local/'$php_file_dir'/bin/php'
|
php='/usr/local/'$php_file_dir'/bin/php'
|
||||||
phpize='/usr/local/'$php_file_dir'/bin/phpize'
|
phpize='/usr/local/'$php_file_dir'/bin/phpize'
|
||||||
php_config='/usr/local/'$php_file_dir'/bin/php-config'
|
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'
|
pecl='/usr/local/'$php_file_dir'/bin/pecl'
|
||||||
|
|
||||||
if [ 'a'$1 == 'a' ];then
|
if [ 'a'$1 == 'a' ];then
|
||||||
@ -39,6 +39,7 @@ case $extension in
|
|||||||
cd $libmcrypt_dir
|
cd $libmcrypt_dir
|
||||||
./configure --prefix=/usr/local/libmcrypt
|
./configure --prefix=/usr/local/libmcrypt
|
||||||
make -j$thread && make install
|
make -j$thread && make install
|
||||||
|
cd $PWD
|
||||||
if [ $? != 0 ];then
|
if [ $? != 0 ];then
|
||||||
echo 'libmcrypt安装失败'
|
echo 'libmcrypt安装失败'
|
||||||
exit 1
|
exit 1
|
||||||
@ -46,12 +47,23 @@ case $extension in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
if [ `$php -m|grep $extension|wc -l` == 0 ];then
|
if [ `$php -m|grep $extension|wc -l` == 0 ];then
|
||||||
ext_dir=$PWD'/package/'$php_file_dir'/ext'
|
ext_dir=$PWD'/package/'$php_file_dir'/ext'
|
||||||
extension_dir=$ext_dir'/'$extension
|
extension_dir=$ext_dir'/'$extension
|
||||||
install_extension $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
|
if [ ! -d $extension_dir ];then
|
||||||
$pecl install $extension
|
$pecl install $extension
|
||||||
pecl_error=$?
|
pecl_error=$?
|
||||||
@ -86,6 +98,9 @@ if [ `$php -m|grep $extension|wc -l` == 0 ];then
|
|||||||
mcrypt)
|
mcrypt)
|
||||||
./configure --with-php-config=$php_config --with-mcrypt=/usr/local/libmcrypt
|
./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
|
./configure --with-php-config=$php_config
|
||||||
;;
|
;;
|
||||||
@ -96,9 +111,11 @@ if [ `$php -m|grep $extension|wc -l` == 0 ];then
|
|||||||
fi
|
fi
|
||||||
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`
|
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
|
if [ ! -f $php_conf_d'/'$extension'.ini' ] && [ $dir_extension_num != 0 ];then
|
||||||
echo 'extension='$extension'.so' >> $php_ini
|
echo 'extension='$extension'.so' >> $php_conf_d'/'$extension'.ini'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
19
bin/php.sh
19
bin/php.sh
@ -13,7 +13,6 @@ install_php
|
|||||||
# 获取配置
|
# 获取配置
|
||||||
thread=`get_config core thread`
|
thread=`get_config core thread`
|
||||||
package=`get_config php package`
|
package=`get_config php package`
|
||||||
libmcrypt_package=`get_config lib libmcrypt_package`
|
|
||||||
server_type=`get_config server type`
|
server_type=`get_config server type`
|
||||||
apache_package=`get_config server apache_package`
|
apache_package=`get_config server apache_package`
|
||||||
nginx_package=`get_config server nginx_package`
|
nginx_package=`get_config server nginx_package`
|
||||||
@ -29,20 +28,6 @@ fi
|
|||||||
|
|
||||||
# 下载地址
|
# 下载地址
|
||||||
package=`exists_download $package`
|
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
|
# 安装php
|
||||||
@ -55,7 +40,7 @@ case $server_type in
|
|||||||
apache_file_name=`get_path_name $apache_package`
|
apache_file_name=`get_path_name $apache_package`
|
||||||
apache_file_dir=`get_file_dir $apache_file_name`
|
apache_file_dir=`get_file_dir $apache_file_name`
|
||||||
apxs_path='/usr/local/'$apache_file_dir'/bin/apxs'
|
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
|
make -j$thread && make install
|
||||||
error=$?
|
error=$?
|
||||||
if [ $error == 0 ];then
|
if [ $error == 0 ];then
|
||||||
@ -77,7 +62,7 @@ case $server_type in
|
|||||||
nginx)
|
nginx)
|
||||||
nginx_file_name=`get_path_name $nginx_package`
|
nginx_file_name=`get_path_name $nginx_package`
|
||||||
nginx_file_dir=`get_file_dir $nginx_file_name`
|
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
|
make -j$thread && make install
|
||||||
error=$?
|
error=$?
|
||||||
if [ $error == 0 ];then
|
if [ $error == 0 ];then
|
||||||
|
|||||||
@ -6,12 +6,13 @@ apache_package=http://www.apache.org/dist/httpd/httpd-2.4.39.tar.bz2
|
|||||||
type=mysql
|
type=mysql
|
||||||
package=http://mirrors.163.com/mysql/Downloads/MySQL-5.5/mysql-5.5.61.tar.gz
|
package=http://mirrors.163.com/mysql/Downloads/MySQL-5.5/mysql-5.5.61.tar.gz
|
||||||
[php]
|
[php]
|
||||||
package=https://www.php.net/distributions/php-7.1.29.tar.bz2
|
package=https://www.php.net/distributions/php-7.2.18.tar.bz2
|
||||||
php_extension=bcmath,ctype,curl,filter,gd,iconv,imagick,libxml,mbstring,openssl,pdo_pgsql,redis,session,sockets,amqp
|
php_extension=openssl,zlib,mbstring,bz2,gd,pdo_pgsql,mcrypt,imagick,redis,amqp
|
||||||
[lib]
|
[lib]
|
||||||
apr_package=http://www.apache.org/dist/apr/apr-1.7.0.tar.bz2
|
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
|
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
|
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
|
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]
|
[core]
|
||||||
thread=4
|
thread=4
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user