Change to use MySQL native driver (mysqlnd).

This commit is contained in:
Christoph 2018-02-22 17:28:56 +01:00
parent cd68ec3346
commit 014bb6d877

View File

@ -349,58 +349,6 @@ done
_PHP_FPM_USER=$HTTPD_USER _PHP_FPM_USER=$HTTPD_USER
_PHP_FPM_GROUP=$HTTPD_GROUP _PHP_FPM_GROUP=$HTTPD_GROUP
echo ""
echo ""
echo -e "\033[32m--\033[m"
echo ""
echo "Insert Path to MySQL Installation directory."
echo ""
echo "Type:"
echo -e "\t\033[33mSystem\033[m if installed from package system"
echo -e "\t\033[33mNot Installed\033[m if no MySQL installation is present"
echo ""
echo ""
if [ -d "/usr/local/mysql/bin" ]; then
_MYSQL_INSTALL_DIR="/usr/local/mysql"
else
__mysql_bin="`which mysql`"
if [ -n "$__mysql_bin" ] ; then
_MYSQL_INSTALL_DIR="System"
else
_MYSQL_INSTALL_DIR="Not Installed"
fi
fi
MYSQL_INSTALL_DIR=
while [ "X$MYSQL_INSTALL_DIR" = "X" ]
do
echononl "MySQL Installation Directory [${_MYSQL_INSTALL_DIR}]: "
read MYSQL_INSTALL_DIR
if [ "X$MYSQL_INSTALL_DIR" = "X" ]; then
MYSQL_INSTALL_DIR=$_MYSQL_INSTALL_DIR
if [ -x "$_MYSQL_INSTALL_DIR/bin/mysql" ]; then
break
fi
fi
__to_lower=`echo $MYSQL_INSTALL_DIR | tr '[:upper:]' '[:lower:]' | tr -d ' '`
if [ "$__to_lower" = "system" ]; then
MYSQL_INSTALL_DIR="system"
break
fi
if [ "$__to_lower" = "notinstalled" ]; then
MYSQL_INSTALL_DIR="not_installed"
break
fi
if [ -x "$MYSQL_INSTALL_DIR/bin/mysql" ]; then
break
fi
echo ""
echo -e "\t\033[31mNo Mysql Instalation found at \"$MYSQL_INSTALL_DIR\" !! Try again..\033[m"
echo ""
MYSQL_INSTALL_DIR=""
done
echo "" echo ""
echo "" echo ""
echo -e "\033[32m--\033[m" echo -e "\033[32m--\033[m"
@ -896,8 +844,8 @@ echo ""
echo "Apache User...................: $HTTPD_USER" echo "Apache User...................: $HTTPD_USER"
echo "Apache Group..................: $HTTPD_GROUP" echo "Apache Group..................: $HTTPD_GROUP"
echo "" echo ""
echo "MySQL Installation directory..: $MYSQL_INSTALL_DIR" #echo "MySQL Installation directory..: $MYSQL_INSTALL_DIR"
echo "" #echo ""
echo "Install with FPM support......: $WITH_PHP_FPM_SUPPORT" echo "Install with FPM support......: $WITH_PHP_FPM_SUPPORT"
if $WITH_PHP_FPM_SUPPORT ; then if $WITH_PHP_FPM_SUPPORT ; then
echo " Activate FPM init script...: $ACTIVATE_PHP_FPM_INIT_SCRIPT" echo " Activate FPM init script...: $ACTIVATE_PHP_FPM_INIT_SCRIPT"
@ -1197,6 +1145,8 @@ config_params="
--with-gd \ --with-gd \
--with-pgsql \ --with-pgsql \
--with-pdo-pgsql \ --with-pdo-pgsql \
--with-pdo-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-pcre-regex \ --with-pcre-regex \
--enable-wddx \ --enable-wddx \
--enable-exif \ --enable-exif \
@ -1262,74 +1212,33 @@ fi
if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 2 ]]) \ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -lt 2 ]]) \
|| [[ "$PHP_MAJOR_VERSION" -lt 7 ]] ; then || [[ "$PHP_MAJOR_VERSION" -lt 7 ]] ; then
config_params="$config_params \ config_params="$config_params \
--with-mcrypt" --with-mcrypt"
fi fi
if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
config_params="$config_params \
--with-mysql=mysqlnd"
fi
if [ "$MYSQL_INSTALL_DIR" != "not_installed" ]; then _mysql_socket=""
if [ "$MYSQL_INSTALL_DIR" = "system" ];then _mysql_config="$(which mysql_config)"
if [ -f "/etc/mysql/my.cnf" ]; then if [[ -z "$_mysql_config" ]]; then
_mysql_socket="`cat /etc/mysql/my.cnf | grep -E \"^\s*socket\" | head -1 | awk '{print$3}'`" if [[ -x "/usr/local/mysql/bin/mysql_config" ]]; then
if [ -S "$_mysql_socket" ]; then _mysql_config="/usr/local/mysql/bin/mysql_config"
if [[ "$PHP_MAIN_VERSION" = "5.4" ]]; then
config_params="$config_params \
--with-mysql \
--with-pdo-mysql \
--with-mysql-sock"
else
config_params="$config_params \
--with-mysqli \
--with-pdo-mysql \
--with-mysql-sock"
fi
else
if [[ "$PHP_MAIN_VERSION" = "5.4" ]]; then
config_params="$config_params \
--with-mysql \
--with-pdo-mysql "
else
config_params="$config_params \
--with-mysqli \
--with-pdo-mysql "
fi
fi
else
## - since version 7.0: unrecognized options --with-mysql
## -
if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
config_params="$config_params \
--with-mysql"
fi
if [[ "$PHP_MAIN_VERSION" = "5.4" ]]; then
config_params="$config_params \
--with-pdo-mysql "
else
config_params="$config_params \
--with-mysqli \
--with-pdo-mysql "
fi
fi
else
## - since version 7.0: unrecognized options --with-mysql
## -
if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
config_params="$config_params \
--with-mysql=$MYSQL_INSTALL_DIR"
fi
if [[ "$PHP_MAIN_VERSION" = "5.4" ]]; then
config_params="$config_params \
--with-pdo-mysql=$MYSQL_INSTALL_DIR \
--with-mysql-sock"
else
config_params="$config_params \
--with-mysqli=${MYSQL_INSTALL_DIR}/bin/mysql_config \
--with-pdo-mysql=$MYSQL_INSTALL_DIR \
--with-mysql-sock"
fi
fi fi
fi fi
if [[ -x "$_mysql_config" ]]; then
if $_mysql_config --socket > /dev/null 2>&1 ; then
_mysql_socket="$($_mysql_config --socket)"
fi
fi
if [[ -n "$_mysql_socket" ]]; then
config_params="$config_params \
--with-mysql-sock=$_mysql_socket"
else
config_params="$config_params \
--with-mysql-sock"
fi
if $WITHOUT_APACHE_MOD_PHP ; then if $WITHOUT_APACHE_MOD_PHP ; then
config_params="$config_params --without-apxs2 --with-config-file-path=${PREFIX_PHP}/etc" config_params="$config_params --without-apxs2 --with-config-file-path=${PREFIX_PHP}/etc"