Plugin installation works only with FTP – how to debug?

I’ve found the answer here.

In brief, WordPress performed some checks to see if it has enough write permissions, and those checks failed.

To skip those tests and simply create the files, one must place this somewhere in the wp-config.php file:

define(‘FS_METHOD’, ‘direct’);