Plugins Directory path 403 forbidden. Nginx

This may be a dumb question… But is there a certain way to set my permissions to allow access to my plugins folder through a url within a browser - ex: ‘sitename.com/app/plugins/woocommerce/’.

I went ahead and changed all the folder permissions to 777, but i still cannot access the folder. Is there something else pre-configured that i have to change in bedrock/trellis files?

Obviously, this is temporary for testing purposes, on a staging server, and know this is not secure for production. I am using a subdomain for the staging server which i don’t know if that could be causing issues.

Thanks!

It’s not clear why you need to access this directory, but I’d guess you’re not able to visit it because NGINX is preventing directory listing. You should be able to disable that if you can change your NGINX config: https://nginxlibrary.com/enable-directory-listing/

Hey @alwaysblank, i figured it out. I changed the nginx config to include:

location /app/plugins {
       autoindex on;
}

I am now seeing that the issues is the plugin developer is using: require_once('../../../wp-load.php'); within his plugin file therefore causing the deeper error, being that the bedrock folder structure is different than traditional wordpress.

What is the best way to dynamically handle wp-load.php within plugins so i can provide them with that information. Thank you!

There’s not a great deal you can do beyond contacting the plugin author and asking them to build their plugin correctly.

Bedrock operates firmly within the bounds of what WordPress defines as acceptable, so plugins that don’t work with it are often not operating within that same framework. See: https://roots.io/bedrock/docs/bedrock-compatibility/ More specifically, loading wp-load.php is a bad practice. See: http://ottopress.com/2010/dont-include-wp-load-please/

If the plugin author is unwilling or unable to fix the issue, you could:

  • Find a different plugin that meets your needs
  • Write the functionality the plugin provides yourself
  • Fork the plugin and fix the issue (not recommended)
  • Not use Bedrock.

This topic was automatically closed after 42 days. New replies are no longer allowed.