0

I originally posted this on Stack Overflow but felt it would be better here.

I've got a Wordpress docker container that isn't really responding. Trying to access it from the browser results in an empty page. No 404 or anything. Trying curl from either a computer on the network, or the server itself returns an empty response as well.

I've done a docker exec -ti container bash into it to try and run curl from within, and it's also empty. /var/www/html is populated, and the single entry in /etc/apache2/sites-enabled is pointing to the /var/www/html directory.

There are no errors in /var/log/apache2/errors to speak of, which isn't helpful.

I've done the usual netstat -tlpn to verify that the server is listening on the correct port, and it is. I've also changed the addresses in the wp database to localhost, to see if that was causing the issue, but that didn't change anything.

Here's my docker-compose.yml, which is very simple

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: PASSWORD
       MYSQL_DATABASE: DBNAME
       MYSQL_USER: USERNAME
       MYSQL_PASSWORD: PASSWORD

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - ./upload.ini:/usr/local/etc/php/conf.d/uploads.ini
     ports:
       - "80:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:PORT
       WORDPRESS_DB_USER: USERNAME
       WORDPRESS_DB_PASSWORD: PASSWORD
       WORDPRESS_DB_NAME: DBNAME
volumes:
    db_data: {}

I'm at a loss as to what to check next, and am hoping to find ideas here.

9
  • The WP container should have a license.txt and readme.html in /var/www/html, can you access them through browser/curl? – kero Feb 24 at 11:24
  • I cannot. Tried both files to no avail. – Ross Wardrup Feb 24 at 11:26
  • I take that back. In my early morning stupor, I reversed the extensions. The files are loadable. – Ross Wardrup Feb 24 at 11:36
  • I've verified that it's loading PHP files with a phpinfo() test. – Ross Wardrup Feb 24 at 11:47
  • So the server is running, PHP is working. Only WordPress itself is making problems? – kero Feb 24 at 11:49
1

I believe the answer was a messed up entry in either site_url or home within the MySQL database. I changed those settings and the issue was resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.