WordPress normally chooses how to write files for updates automatically. The FS_METHOD constant can override that choice when a hosting-specific configuration requires it.

Confirm whether an override is needed

Record the update error and ask the provider which filesystem method the installation should use. A credentials prompt can indicate an ownership or configuration issue; forcing direct does not automatically resolve it.

Back up wp-config.php and keep it private. Its location depends on the WordPress installation, rather than always being the site’s public root.

Set the approved method

If the provider confirms that direct PHP file writes are appropriate:

  1. Open the installation’s wp-config.php through a secure file-management method.
  2. Look for an existing FS_METHOD definition and edit it rather than adding a duplicate.
  3. If absent, add this before WordPress loads wp-settings.php:
define( 'FS_METHOD', 'direct' );
  1. Save and test the previously failing update.

If the override does not help, restore the previous configuration and investigate the actual failure. Other supported methods depend on installed PHP extensions and the hosting setup; choose them with the provider rather than changing values at random.