Local Installed WordPress Configuration for Further Install or Update

Posted on

Platform Web    : WordPress 4.5.2

Platform OS        : Ubuntu 16.04 (Xenial Xerus)

Text file Editor   : vim

Basically, the installation and the configuration process of web powered by WordPress can be done locally. Depends on the goal or purpose of doing locally, many developers, testers, designers whom are working with WordPress as the main framework of the web will start doing their job on a secluded area of development either in their local PC, laptop or internal server.

Tolerating on making mistakes, trial and error and even redesign or rebuild the already deployed web-based WordPress from the start. It is an advantage of doing it locally and specifically intended for development purpose.

After installing and configuring WordPress locally, there are several requirements which are needed to be accomplished by installing and updating additional components of the web-based WordPress itself. The installation and update process require internet connection and the already configured web-based WordPress need to be set in order to do it.

Normally, after the minimal installation of web-based WordPress, below is the page which is displayed when we want to install plugins and to update either the wordpress or the plugin :

02-install-update-plugin-wordpress
Displaying one of the method which is used to update in WordPress from Dashboard page.

The above page is received by accessing the Updates link as shown in detail below :

01-install-update-plugin-wordpress
Displaying Sidebar menu of Dashboard’s WordPress-based website. The sidebar displays information shows there are updates available.

The above step will need several entry to be done before installing or updating process. To be able to do it directly, first of all the configuration file need to be updated.

Open the configuration file named wp-config.php and there will be a snippet code display display as follow when it is opened with a file editor named vim :

04-install-update-plugin-wordpress
Displaying file configuration of WordPress-based website.

When we display it in plain text :

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

It need to be added with the following line :

define('FS_METHOD', 'direct');

So, it will be displayed as follow in the vim text editor :

Based on the information given in the WordPress Codex, there are four types of value which can be used as the value of FS_METHOD parameter. The FS_METHOD parameter itself is a parameter which forces the filesystem method.

The information which is given in the WordPress Codex states that the default value of FS_METHOD parameter is direct if it is not defined in the wp-config.php as the configuration file. But somehow after fresh installation of WordPress, it is actually act  as where the FS_METHOD is ‘ftpext’.

So, in order to change the way WordPress behave when the installation or update process is executed so the process will be directly proceed instead of using FTP method, we need to define the FS_METHOD in the wp-config.php as the configuration file.  And it is already done in the above step.

Below is the FS_METHOD parameter information based on information given which is directly copied from the WordPress Codex :

FS_METHOD forces the filesystem method. It should only be "direct", "ssh2", "ftpext", or "ftpsockets". Generally, you should only change this if you are experiencing update problems. If you change it and it doesn't help, change it back/remove it. Under most circumstances, setting it to 'ftpsockets' will work if the automatically chosen method does not. Note that your selection here has serious security implications. If you are not familiar with them, you should seek help before making a change.

(Primary Preference) "direct" forces it to use Direct File I/O requests from within PHP. It is the option chosen by default.
(Secondary Preference) "ssh2" is to force the usage of the SSH PHP Extension if installed 
(3rd Preference) "ftpext" is to force the usage of the FTP PHP Extension for FTP Access, and finally
(4th Preference) "ftpsockets" utilises the PHP Sockets Class for FTP Access.

One thought on “Local Installed WordPress Configuration for Further Install or Update

Leave a Reply