Debug.log Not Generating in WordPress on Elastic Beanstalk

0

I am encountering an issue where the debug.log file is not generating in my WordPress installation on an Elastic Beanstalk environment. Despite enabling WordPress debug mode and setting the necessary configurations in wp-config.php, the debug.log is not generating in wp-content folder. Here are the steps I have taken thus far:

Added the following lines to wp-config.php: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 );

I've also check the file permissions of wp-content which is "drwxr-xr-x" and it appears okay. I checked as well the log_errors in php.init and it's "On". Any idea how to resolve this? Thank you in advance.

profile picture
Vin
已提問 8 個月前檢視次數 240 次
1 個回答
1
已接受的答案

Hello.

It is possible that the php-fpm settings are outputting to "/var/log/php-fpm/www-error.log".
Please check this log file.

profile picture
專家
已回答 8 個月前
  • You mean the content of www-error.log in the path "/var/log/php-fpm/www-error.log" is the same as the content of debug.log?

  • I think it depends on the settings of php-fpm, but if you haven't changed anything, it will probably be output to "/var/log/php-fpm/www-error.log". I think it would be a good idea to actually look at the contents of the log.

  • Thank you for the insight Riku! I'm trying to find out the root cause of the issue because if this is no longer related to elastic beanstalk, I would be resolving this post.

  • You're correct it depends on the www.conf of the php-fpm. The debug.log is now appearing in my wp-content when I commented out the "php_admin_value[error_log] = /var/log/php-fpm/www-error.log" and "php_admin_flag[log_errors] = on". The file www.conf is being managed by elastic beanstalk. I found the solution in this link: https://wordpress.org/support/topic/wp_debug_log-never-gets-created-permissions-correct-php-8-apache-2-4-51/. Thank you much again for guiding me all the way.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南