WordPress: Difference between revisions

imported>Onny
mNo edit summary
imported>Onny
Add infos about error logging
Line 116: Line 116:
</syntaxHighlight>
</syntaxHighlight>


== Troubleshooting ==
=== Enable logging ===
To enable logging add the following lines to <code>extraConfig</code>
<syntaxHighlight lang="nix">
services.wordpress.sites."localhost".extraConfig = ''
  define( 'WP_DEBUG', true );
  define( 'WP_DEBUG_LOG', true );
  ini_set( 'error_log', '/var/lib/wordpress/localhost/debug.log' );
'';
</syntaxHighlight>
Since the default location to the folder <code>wp-content</code> is not writable, we redirect the log file path to <code>/var/lib/wordpress/localhost/debug.log</code>. All error messages will be stored there. Change the folder name ''localhost'' to the name of your site.
In case you want to print error messages directly in your browser, append following line
<syntaxHighlight lang="nix">
services.wordpress.sites."localhost".extraConfig = ''
  @ini_set( 'display_errors', 1 );
'';
</syntaxHighlight>
Please note that this exposes sensible information about your server setup therefore this option should not be enabled in production.


[[Category:Services]]
[[Category:Services]]
[[Category:Web Applications]]
[[Category:Web Applications]]