Search code examples
phpnginxfpm

PHP 7.2 - FPM - NGINX - Can't get a php error log outputted no matter what I do


One of my endpoints returns 500 - Server error. I can't configure the system to show me where the crash is.

I've done this:

in /etc/php/7.2/fpm/php.ini

php_admin_flag[log_errors] = on;
php_admin_value[error_log] = /var/www/html/production/php-error.log;

Solution

  • Nginx logs are usually found in /var/log/nginx/. If you want to modify the filename/directory, you will need to modify the error_log directive in the site configuration file, in /etc/nginx/sites-enabled/ or /etc/nginx/sites-available (same file, the sites-enabled files are linked to the same file in the /etc/nginx/sites-available folder)