Сообщение об ошибке:
configure: error: wrong mysql library version or lib not found. Check config.log for more information.
The command '/bin/sh -c ./configure --prefix=/usr/local/php/install --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php-7.3.2/ --enable-libgcc --with-mysqli=/usr/local/mysql/install/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/install/ --with-zlib-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-gd=/usr/local --with-freetype-dir=/usr --enable-ftp --enable-xml --enable-zip --with-bz2 --enable-wddx --without-pear --enable-mbstring --with-openssl --with-curl --enable-intl && make && make install && make clean' returned a non-zero code: 1
выдается командой configure из Dockerfile:
# Installing php
WORKDIR /usr/local/include
RUN ln -s /usr/include/x86_64-linux-gnu/curl curl
RUN apt-get update \
&& apt-get install -y \
libxml2-dev libxslt-dev \
libicu-dev \
pkg-config \
libcurl4-gnutls-dev \
re2c libzip-dev
WORKDIR /usr/local/
COPY php-7.3.2.tar.gz /usr/local/
RUN gzip -d php-7.3.2.tar.gz \
&& tar -xvf php-7.3.2.tar \
&& ln -s php-7.3.2 php
WORKDIR /usr/local/php/
RUN ./configure \
--prefix=/usr/local/php/install \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php-7.3.2/ \
--enable-libgcc \
--with-mysqli=/usr/local/mysql/install/bin/mysql_config \
--with-pdo-mysql=/usr/local/mysql/install/ \
--with-zlib-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-gd=/usr/local \
--with-freetype-dir=/usr \
--enable-ftp \
--enable-xml \
--enable-zip \
--with-bz2 \
--enable-wddx \
--without-pear \
--enable-mbstring \
--with-openssl \
--with-curl \
--enable-intl \
&& make \
&& make install \
&& make clean
Ранее сервер MySQL был успешно установлен с Dockerfile:
FROM stephaneeybert/ubuntuos:18.04
# Installing the mysql client
RUN apt-get install -y libncurses-dev
COPY mysql-8.0.15.tar.gz /usr/local/
WORKDIR /usr/local
RUN gzip -d mysql-8.0.15.tar.gz \
&& tar -xvf mysql-8.0.15.tar \
&& mv mysql-8.0.15 mysql-source
RUN mkdir mysql
WORKDIR /usr/local/mysql/
RUN mkdir install \
&& mkdir install/data \
&& mkdir install/var \
&& mkdir install/etc \
&& mkdir install/tmp
WORKDIR /usr/local/mysql/
RUN cmake -- -j4 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql/install \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITHOUT_TOKUDB=1 \
-DMYSQL_DATADIR=/usr/local/mysql/install/data \
-DDOWNLOAD_BOOST=1 \
-DWITH_BOOST=/usr/local/mysql/install/boost \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/install/tmp/mysql.sock \
/usr/local/mysql-source/ \
&& make \
&& make install \
&& make clean
Файл config.log
содержит следующее:
configure:51849: checking for MySQLi support
configure:51885: result: yes
configure:51894: checking whether to enable embedded MySQLi support
configure:51908: result: no
configure:51917: checking for specified location of the MySQL UNIX socket
configure:51932: result: no
configure:52066: checking for mysql_set_server_option in -lmysqlclient_r
configure:52091: cc -o conftest -I/usr/include -g -O2 -fvisibility=hidden -pthread -D_REENTRANT -Wl,-rpath,/usr/local/mysql/install/lib -L/usr/local/mysql/install/lib -L/usr/lib -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7 -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lm -lrt -lssl -lcrypto -ldl conftest.c -lmysqlclient_r -lstdc++ -lgd -lpng -lz -ljpeg -lpng -lz -ljpeg -lbz2 -lz -lrt -lm -ldl -lnsl -lpthread -lgcc -lxml2 -lssl -lcrypto -lcurl -lxml2 -lssl -lcrypto -lfreetype -lfreetype -licui18n -licuuc -licudata -licuio >&5
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: error: ld returned 1 exit status
Действительно, в каталоге lib
нет файла mysqlclient_r
:
root@7d84572cf230:/usr/local/php# ll /usr/local/mysql/install/lib
total 78904
drwxr-xr-x 5 root root 4096 Feb 10 16:21 ./
drwxrwxr-x 17 root root 4096 Feb 10 16:21 ../
-rw-r--r-- 1 root root 25593504 Feb 10 10:28 libmysqlclient.a
lrwxrwxrwx 1 root root 20 Feb 10 16:19 libmysqlclient.so -> libmysqlclient.so.21
lrwxrwxrwx 1 root root 25 Feb 10 16:19 libmysqlclient.so.21 -> libmysqlclient.so.21.0.15
-rw-r--r-- 1 root root 11087808 Feb 10 10:28 libmysqlclient.so.21.0.15
-rw-r--r-- 1 root root 18383678 Feb 10 16:07 libmysqlharness.a
lrwxrwxrwx 1 root root 20 Feb 10 16:21 libmysqlharness.so -> libmysqlharness.so.1
-rw-r--r-- 1 root root 7750224 Feb 10 16:09 libmysqlharness.so.1
lrwxrwxrwx 1 root root 19 Feb 10 16:21 libmysqlrouter.so -> libmysqlrouter.so.1
-rw-r--r-- 1 root root 17906048 Feb 10 16:11 libmysqlrouter.so.1
-rw-r--r-- 1 root root 43678 Feb 10 10:30 libmysqlservices.a
drwxr-xr-x 2 root root 4096 Feb 10 16:21 mysqlrouter/
drwxr-xr-x 2 root root 4096 Feb 10 16:19 pkgconfig/
drwxr-xr-x 3 root root 4096 Feb 10 16:19 plugin/