1. Home
  2. Issues
  3. Permission Denied Error

Permission Denied Error

The Log Hero WordPress plugin gathers log events in a log file to send them in a batch to the Log Hero API to ensure fast loading times for your visitors. The log file is a simple text file placed in the “logs” folder of the plugin. For most setups, the folder will be “wp-content/plugins/loghero/logs”. The Log Hero WordPress plugin needs write permissions for that folder, which it should have anyway if it is a standard WordPress setup.

However, with some installations, the following error message appears:

How to fix it

Changing folder permission

Verify that the WordPress user has write permissions on the logs folder. You can use an FTP client like sftp:

sftp <your-user>@<your-host>
sftp> cd /wp-content/plugins/loghero
sftp> ls -l

The “logs” folder must have set the permissions “drwxr-xr-x”. If permissions are not set correctly, run “chmod 755 logs”.

Use Redis as log buffer and flush synchronously

A workaround for the permission denied error is using the Redis log buffer in combination with synchronuous flush. This way, the plugin doesn’t need to access the logs directory. Navigate to the LogHero settings page in your WordPress admin, set the Redis URL and activate the “Disable Async Mode“ checkbox:

redis-log-buffer-setup

Updated on September 11, 2018

Was this article helpful?

Related Articles

Add A Comment