The php image includes a couple scripts to help you install extensions in images build FROM the php image. Take a look at “How to install more PHP extensions” on https://hub.docker.com/_/php/.
Basically, you’ll create a Dockerfile that builds FROM this image. Next, you’ll apt-get install any dependencies needed for the mysql extension, and then use docker-php-ext-configure and docker-php-ext-install to actually install the extension.
Thanks for your reply about this problem and you're right that I miss to install the mysql extensions.No mysql.so exist in this container.
I think I use a foolish way to solve this problem.
I enter /usr/src/php/ext/mysql to generate mysql.so manually.
1.root@c65017696ff0:/usr/src/php/ext/mysql# phpize
2.root@c65017696ff0:/usr/src/php/ext/mysql# ./configure
3.root@c65017696ff0:/usr/src/php/ext/mysql# make
4.root@c65017696ff0:/usr/src/php/ext/mysql# make install
5.root@c65017696ff0:#cp /usr/src/php/ext/mysql/modules/mysql.so /usr/src/php/ext
6.Add 2 lines into /usr/local/etc/php/php.ini file
extension=mysql.so
extension_dir = /usr/src/php/ext
7.Restart apache2
apache2ctl -k restart
Finally I commit the container to make a local PHP image.
Thank you .
When I upgraded my website PHP from version 5.6 to 7.2, I encountered this problem “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”. It turns out that mysql extension is no longer supported in php version 7.2. It is now using mysqli extention. I am using old version of wordpress which still using mysql extension that is why the problem existed. So what I did is upgraded the wordpress to the core. This solve the problem.
Here’s the steps I followed when upgrading wordpress manually.
First I created a full backup of my website Fraction Calc. This is very important in case of mistake.
I download the newest WordPress ZIP file from wordpress.org.
I unzipped the file into a local directory of my computer.
I went to my website root directory and deleted your ‘wp-includes’ and ‘wp-admin’ directories. I used sFTP connection using Filezilla software.
I uploaded the new wp-includes and wp-admin directories from the new version of WordPress I unzipped to my website root directory and replaced the directories I just deleted.
I did not delete the wp-content directory or any of the files in that directory. I just copied over the files from the wp-content directory in the new version of WordPress to my existing wp-content directory. All existing files with the same name have been overwritten.
I copied all files from the root (‘/’) directory of the new version of WordPress that I unzipped into my website root directory (or the root directory of your WordPress installation). Existing files has been overwritten and new files has been copied across. wp-config.php file was not be affected because WordPress has never distributed with a wp-config.php file.
I compare wp-config-sample.php which was\s distributed with WordPress but did not find anything to change so I just used the old one.
I cleared my browser cache to ensure I can see all changes.
I checked the site and there is no error now. Thanks God the upgrade was completed.