Stop WordPress asking for FTP info and allow it to install plugins

Chris Abernethy publishes a good solution to stop WordPress asking for connection info upon installing plugins, however I have discovered an alternative fix, if you don’t want to change the file owners

The use-case for this is if you are working in a subdirectory of your home folder, and don’t want to make www-data the owner of everything under public_html.

This change makes WordPress to do the permission check by group id:

  1. Open up the file wp-admin/includes/file.php
  2. Find line if ( getmyuid() == @fileowner($temp_file_name) )
  3. Change to if ( getmygid() == @fileowner($temp_file_name) )
  4. Save and close

Leave a Reply

*

Contact Nixz Kerr