问题
I'm trying to customize a default PHP image to develop a wordpress plugin locally
This the docker-compose.yml section about wordpress service
wordpress:
container_name: wordpress
build: actual-wordpress
#image: php:5.5-apache
volumes:
- ./actual-wordpress/www/:/var/www/html/
- ./actual-wordpress/wp-config-local.php:/var/www/html/wp-config.php
- ./actual-wordpress/srtool/:/var/www/html/srtool/
depends_on:
- db
ports:
- 8000:80
restart: always
And this is the 'actual-wordpress' dockerfile being builded
FROM php:5.5-apache
RUN apt-get update; \
apt-get install -y --no-install-recommends php5-gd php5-mysql
As you can see, I manually install php5-gd php5-mysql
When I run the container, I got this error
Fatal error in /var/www/html/wp-includes/wp-db.php, line 1570. Call to undefined function mysql_connect()
Could not find any MySQL database drivers. (MySQLi or PDO required.)
How can I resolve this issue?
回答1:
docker-php-ext-install mysql mysqli pdo pdo_mysql
来源:https://stackoverflow.com/questions/41955914/docker-could-not-find-any-mysql-database-drivers-mysqli-or-pdo-required