Wordpress: Empty reply from server

Created on 19 Sep 2018  路  5Comments  路  Source: docker-library/wordpress

I'm having a similar issue to https://github.com/docker-library/wordpress/issues/164 yet the described solution does not help me.

version: '3.1'

volumes:
  mysql-volume:
  wordpress-volume:

services:
  mysql:
    build: ./mysql
    container_name: mysql
    volumes:
      - mysql-volume:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 123
      MYSQL_DATABASE: db
      MYSQL_USER: user
      MYSQL_PASSWORD: 123

  wordpress:
    image: wordpress:4.9.8-php7.2-fpm-alpine
    container_name: wordpress
    volumes:
      - wordpress-volume:/var/www/html/wp-content
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: mysql:3306
      WORDPRESS_DB_NAME: bcurious_wordpress
      WORDPRESS_DB_USER: user
      WORDPRESS_DB_PASSWORD: 123
    depends_on:
      - mysql

The build of mysql ensures that the database exists allowing wordpress to create the required tables.

docker-compose down -v && docker-compose up let's me know that it's ready to handle connections.

Yet:

> curl localhost:8080
curl: (52) Empty reply from server 

On the host. And...

/var/www/html # curl wordpress:8080
curl: (7) Failed to connect to wordpress port 8080: Connection refused
/var/www/html # curl localhost:8080
curl: (7) Failed to connect to localhost port 8080: Connection refused
/var/www/html #

Inside the container it self.

question

Most helpful comment

PHP-FPM is a separate daemon which speaks the FastCGI protocol to a reverse proxy such as Apache or NGINX -- you'll need to configure those to use TCP + FastCGI to talk to PHP-FPM in order to use the FPM variants of this image.

All 5 comments

Okay turns out it's an issue with that particular image version and not the latests image. Replacing wordpress:4.9.8-php7.2-fpm-alpine with wordpress:latest makes everything work just as I would expect.

wordpress:4.9.8-php7.2-fpm-alpine doesn't have apache webserver, when you switch to the default wordpress:latest it uses apache

Does it intentionally not have Apache webserver? How is the Wordpress fpm-alpine Docker image supposed to be used?

PHP-FPM is a separate daemon which speaks the FastCGI protocol to a reverse proxy such as Apache or NGINX -- you'll need to configure those to use TCP + FastCGI to talk to PHP-FPM in order to use the FPM variants of this image.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haszari picture haszari  路  4Comments

darkl0rd picture darkl0rd  路  5Comments

Wyvern picture Wyvern  路  5Comments

adriatic picture adriatic  路  5Comments

uda picture uda  路  4Comments