chriszarate / docker-compose-wordpress

An example Docker Compose setup for WordPress plugin or theme development.
162 stars 54 forks source link

How to view PHP errors. #12

Closed MikeiLL closed 5 years ago

MikeiLL commented 6 years ago

I'm embarrassed to be asking this question, but I'm not sure how to view php error logs from the wordpress container.

I have created a php.ini file in var/www/html containing:

# -rw-r--r--  1 www-data www-data   107 May 12 20:38 php.ini
display_errors = On
error_reporting = E_ALL | E_STRICT
log_errors = On
error_log = /var/log/php_errors.log

The wp-config.php file has define( 'WP_DEBUG', true );.

No logfile. No Display.

I'm probably missing a step somewhere.

Also want to confirm that the DOCKER_LOCAL_IP for XDEBUG is supposed to be the "local IP" and not the IPV4.

Sorry for the spam, Chris and all.

modelm commented 5 years ago

I think you have to build your own image for that - see https://github.com/docker-library/docs/blob/master/php/README.md#configuration

I'm using a Dockerfile like this:

FROM wordpress

RUN mv "$PHP_INI_DIR"/php.ini-development "$PHP_INI_DIR"/php.ini

& including it by updating docker-compose.yml, replace image: wordpress... with

build: .

With that configuration, errors are displayed in docker-compose logs.