Bug - Installing X extensions fails if FS_METHOD is not defined in wp-config.php

We ran into an issue yesterday when installing a new instance of X, the most recent version at the time of this writing. After searching, we came across an old thread that was exactly the problem, and hinted at a solution.

The error we keep getting when installing is “Your WordPress file permissions do not allow plugins to be installed.”

This error persisted even when we we changed all file and directory permissions in the install to 777.

It took a full day of searching and diagnosing, but the fix is to:

Edit wp-config.php and add define(‘FS_METHOD’,‘direct’);

Without this directive, X will continue to fail to install and it’s virtually impossible to debug why. This error could be more clear. This obviously isn’t a file permissions issue and leads a person in the wrong direction when diagnosing. You may want to consider a better algorithm that helps people when its one situation and not the other, or inform them that if they don’t want to use the FS_METHOD to add FTP credentials in some place. This is a nightmare for those who use SSH to manage the site.

Environment is Ubuntu 16.04, PHP 7.

Hi There,

Thanks for writing in! As we have mentioned in the following post (https://theme.co/apex/forums/topic/unable-to-install-extensions-3/page/2/#post-871800), this is totally due to your server configurations and settings.

We also do not recommend to add FTP credentials into your wp-config.php file and it was just a temporary solution. Please contact your hosting provider with regard to this issue.

Thanks!

@rodhoy I saw this thread and wanted to add a bit more context.

X uses the WordPress filesystem API to install Extensions. It will fail if WordPress doesn’t have proper access to the file system. For example, if you’ve ever seen WordPress request FTP credentials when installing something, that’s because it doesn’t have write permission to where it’s trying to place a file.

Instead of our Extension installer stopping to prompt for FTP credentials, it just aborts. I’m not sure why you need to explicitly declare the FS_METHOD constant, but I can assure you that something is wrong with how WordPress is configured. By default WordPress tries to access files directly, so something else could be telling it otherwise