The hosting server doesn’t necessary allow WordPress to write files.
define( 'FS_METHOD', 'direct' );
Sources:
- https://wordpress.stackexchange.com/questions/189554/what-security-concerns-should-i-have-when-setting-fs-method-to-direct-in-wp-co
- https://kinsta.com/knowledgebase/constant-fs_method/
- https://developer.wordpress.org/reference/functions/get_filesystem_method/