Getting Started With WordPress Development
Published: Sunday, January 26, 2020
Today, I will be discussing how to get started with WordPress development locally; the tools you need and how to set up your developer environment. This will be for Windows users.
MySQL Server & MySQL Workbench
The database engine WordPress uses is MySQL. Head over to MySQL and download their web installer here. Install both MySQL Server and MySQL Workbench.
When installing MySQL server, please use Retain MySQL 5.x Compatibility for its Authentican Method.
Once done open MySQL Workbench and create a database called “wordpress”.
We need a webserver to start to develop locally. Download and install IIS Express 10 here.
PHP 7 For Windows
PHP is the programming language WordPress uses. Since we are using IIS Express, you should use the Non-Thread Safe (NTS) versions of PHP. Download PHP here.
Once unziped, change your php.ini to include the mysqli.dll.
Once done, register PHP with IIS Express by running the following commands in the command prompt as Administrator.
"C:\Program Files (x86)\IIS Express\appcmd.exe" set config /section:system.webServer/fastCGI /+[fullPath='"C:\Program Files (x86)\PHP\php-cgi.exe"'] "C:\Program Files (x86)\IIS Express\appcmd.exe" set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='"C:\Program Files (x86)\PHP\php-cgi.exe"',resourceType='Unspecified']
Change the fullPath and scriptProcessor to your own local variables.
Microsft Visual Studio Code
Finally, download and install WordPress here. Once you unzip WordPress, rename the file wp-config-sample.php to wp-config.php. Open the folder with Visual Studio Code and change the following in wp-config.php.
define( 'DB_NAME', 'wordpress' ); define( 'DB_USER', 'root' ); define( 'DB_PASSWORD', 'password' ); define( 'DB_HOST', 'localhost' );
Once done, in Visual Studio Code, go to View > Command Palette and Start IIS Express! Head over to the WordPress codex here for their documentation.