jbo
jbo

Reputation: 129

docker + wordpress install = error 500

I try to install wordpress on a docker stack. Unfortunately i get an error 500 during the famous 5-minute installation.

"NetworkError: 500 Internal Server Error - http://0.0.0.0:8181/wp-admin/setup-config.php?step=2"

If i have a look on the logs, i get:

172.19.0.4 -  15/Feb/2017:05:21:44 +0000 "GET /v1/wp-admin/setup-config.php" 200
172.19.0.4 -  15/Feb/2017:05:22:37 +0000 "POST /v1/wp-admin/setup-config.php" 500
172.19.0.4 -  15/Feb/2017:05:23:17 +0000 "GET /v1/wp-admin/setup-config.php" 500
172.19.0.4 -  15/Feb/2017:05:24:01 +0000 "POST /v1/wp-admin/setup-config.php" 500

I get the same issue with apache + php + mariadb or nginx + php-fpm + mariadb (server, database and php seem to work well). I don't use wordpress docker image to get more flexibility.

So i think about the permissions. I fix it. In case, i remove the .htaccess and modify php.ini with:

post_max_size   64M
upload_max_filesize 64M

I fail imagination to solve the problem. Maybe an issue with the docker user who is not able to write the wp-config.php file (i don't know what could be the good practice).

Any idea to solve the problem?

Thank you in advance for the help. jB

Upvotes: 2

Views: 3854

Answers (1)

solvease
solvease

Reputation: 539

Please check if mysql extension is installed in php or not. If you see the phpinfo() you will get that.

To Install mysql write the below line in Dockerfile

docker-php-ext-install mysql

Sample Docker file for php 5.6:

FROM php:5.6-fpm
# Install modules
RUN apt-get update && apt-get install -y \
    libmcrypt-dev  \
    libicu-dev \
    mysql-client \
    && docker-php-ext-install mysql \
    && docker-php-ext-install pdo_mysql \
    && docker-php-ext-install iconv \
    && docker-php-ext-install mcrypt \
    && docker-php-ext-install intl \
    && docker-php-ext-install opcache \
    && docker-php-ext-install mbstring 
CMD ["php-fpm"]

enter image description here

Upvotes: 3

Related Questions