I'm using the "php:7.1" docker image to setup the test environment for a new project. I get errors to while trying to use the
$db = new mysqli(...);
functions to acquire a DB connection.
I tried to use the docker image in interactive mode to find the necessary setup steps manually:
docker run -i -t php:7.1 /bin/bash
I run the following steps I found on the net to prepare the "mysqli" functions:
# update image
apt-get update
# install vim for local editing
apt-get install vim
I tried to install mysql from the following post: How to enable MySQLi extension in php 7?
apt-get install php-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php-mysql
I tried to activate the extension only but does not work because the extenstion does not exists:
extension=php_mysqli.dll
Error:
php info.php |grep mysql
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/php_mysqli.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20160303/php_mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
Configure Command => './configure' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--disable-cgi' '--enable-ftp' '--enable-mbstring' '--enable-mysqlnd' '--with-curl' '--with-libedit' '--with-openssl' '--with-zlib'
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password
mysqlnd statistics =>
I have not an idea what I can do to get the extension installed and enabled.