1

I set define( 'WP_DEBUG', true ); & define('WP_DEBUG_LOG', true);. But error_log('hello'); is not printing any thing.

What could be the issue ?

1 Answer 1

2

You'll find error_log output

  • in WordPress's debug.log, under wp-content, if enabled
  • in your web server's error log file, e.g.
    • /var/log/httpd/error_log for Apache, or /var/log/apache2/error_log on Ubuntu
    • /var/log/nginx/default-error.log for nginx
  • or in your PHP FPM service's error log if you're running that instead

It generally won't get output in the web page, no. If you want that you can always echo instead, but be careful not to echo until you've reached the point that WordPress is going to emit the page template: as soon as you echo you prevent the server sending any more HTTP headers.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.