Support » Plugin: Microsoft Azure Storage for WordPress » Filesystem API / permissions

  • In version 4.0.0 of this plugin the WP_Filesystem API is being used to read the recently uploaded files from the default WP upload directory. In the event that the WP_CONTENT directory is not writeable, the underlying call to the WP get_filesystem_method() will fall back to something other than ‘direct’. In some WP production installations the WP_CONTENT directory will not be writeable, only the WP_CONTENT/uploads directory will be, and the end result being Windows_Azure_File_Contents_Provider::is_valid() will fail with ‘Access to WordPress filesystem has not been granted’.

    A workaround is to explicitly define the FS access method as ‘direct’ by setting the following in wp-config.php:

    define( ‘FS_METHOD’, ‘direct’ );

    What’s happening in the plugin is in the case where where wp-content is not writeable and FTP or SSH credentials aren’t specified (because they aren’t used) the call to WP_Filesystem() inside of Windows_Azure_Filesystem_Access_Provider::get_provider() will fail and $filesystem_access never gets initialized, so the upload fails in the middle. This all happens before the $force_direct_access is checked too, so that has no effect in this case.

    This would seem to be somewhat of a design/configuration issue with WordPress, however since the Azure plugin doesn’t actually need write access, it shouldn’t cause the uploads to fail. Potentially, this could be checked for earlier, and/or produce a warning or something?

    Thanks for the great plugin!

    GW

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filesystem API / permissions’ is closed to new replies.