RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.20% (5.24%*) • Home Loan Fixed: 5.48% (6.24%*) • Fixed: 5.48% (6.24%*) • Variable: 5.20% (5.24%*) • Investment IO: 5.78% (6.81%*) • Investment PI: 5.49% (6.32%*)

WordPress Automatic Install and Upgrade Errors

The problem and solution described came about after a friend had issues with her WP installation. To cut a long story short, I had to hard-code FTP details into the wp-config.php file using WordPress Upgrade Constants .

define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'ftp.example.org');
define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');

The second issue that troubled me were the following errors:

Unable to Locate WordPress Plugin Directory

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home/www/wp-admin/includes/class-wp-upgrader.php on line 189

I search the WordPress Codex for a solution and found this snippet (you should copy to your wp-config.php file (although it's code we won't use: see below).

1
<?php 
2
if(is_admin()) {
3
 add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
4
 define( 'FS_CHMOD_DIR', 0751 );
5
}

This will tell WordPress to use the "direct write" method; with create_function as a quick hack. You would then tell WordPress (via defined constants) what permissions to apply to the files and folders it creates.

define( 'FS_CHMOD_DIR', 0777 );
define( 'FS_CHMOD_FILE', 0777 );

However, a quick search of the WordPress Codex found constants that negate the need for any of the above. So, open up config.php and copy the following somewhere near the top of the file.

define( 'FS_METHOD', 'direct' );
define( 'FS_CHMOD_DIR', 0777 );
define( 'FS_CHMOD_FILE', 0777 );

Defining FS_METHOD as"direct" forces WordPress to use Direct File I/O requests from within PHP. The manual sensibly states that this is fraught with opening up security issues on poorly configured hosts. Use with caution.

Common Errors

  • Remember, your wp-content folder should be given appropriate permissions.
  • If the system fails to create an 'upgrade' directory in wp-content, create it manually (as you would with your uploads directory).

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  E. Australia Standard Time [ UTC+10, Default ] [ CHECK TO CHANGE ]

  Want to have a chat?
 

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment