Why is WP_DEBUG not set to true [closed]

Question

I have the following docker compose setup and I cannot find out how to set WP_DEBUG to true.

docker-compose.yml

version: '3.3'

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
      - "22:22"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
      XDEBUG_CONFIG: remote_host=192.168.1.13
      WP_DEBUG: 1
      WORDPRESS_DEBUG: 1
      WORDPRESS_CONFIG_EXTRA: |
        define( 'WP_DEBUG', true );
    working_dir: /var/www/html
    volumes:
      - c:/temp/wp-content:/var/www/html/wp-content
      - c:/temp/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    command:
      - apt-get update 
        && apt-get install vim -y
volumes:
  db_data: {}

My docker image starts up ok with no errors and I can see my site & wp-admin page.

I created a simple plugin to print the debug status…

if (defined('WP_DEBUG') && true === WP_DEBUG) {
    echo 'WP_DEBUG - true';
} else {
    echo 'WP_DEBUG - false';
} 

This prints “WP_DEBUG – false” at the top of the page.

I’ve also checked the wp-config.php file and it shows…

define( 'WP_DEBUG', false );

I’m at a loss to understand how I enable Debug mode inside a docker image.

As you can see from above I have tried these several methods..

  WP_DEBUG: 1
  WORDPRESS_DEBUG: 1
  WORDPRESS_CONFIG_EXTRA: |
    define( 'WP_DEBUG', true );

And several others, it seems the value has to be a 1/0 not true/false.

Any advice would be great.

0
, jeff porter 1 year 2020-07-12T15:11:10-05:00 0 Answers 73 views 0

Leave an answer

Browse
Browse