WordPress uses cURL, and that requires the file cacert.pem. You can download it at https://curl.se/docs/caextract.html. Put the file in your C:\PHP\extras\ssl folder. We also need to enable some PHP modules so enable those too while editing the file. Edit the php.ini (C:\PHP\php.ini) as follows:
curl.cainfo = "C:\PHP\extras\ssl\cacert.pem" (modify line and uncomment ;) extension=php_curl.dll (add line)
WordPress also uses the Imagick library. This is definitely an optional module. We want to try and match our Host Server so let’s go ahead and install it. If you aren’t doing much image processing, I wouldn’t get too excited about not installing it. Go to the ImageMagick page and download the recommended version (we have a 64bit Server). In this example it is ImageMagick-7.0.11-10-Q16-HDRI-x64-dll.exe. Install the program using the defaults it recommends. Now you need to get PHP talking to ImageMagick. Download the latest version from PECL. Not that it is the DLL option you want to click on not the tgz option. Scroll down and you will see the PHP version you need. In this example we have PHP 7.3 and Apache, so we will download the threadsafe x64 version called php_imagick-3.4.4-7.3-ts-vc15-x64.zip. Extract the archive and copy the file php_imagick.dll to C:\PHP\ext. You can delete the uncompressed folder we only needed this DLL. Edit your php.ini file adding this line to the extensions section:
Another download is required located at https://windows.php.net/downloads/pecl/deps/. Pick the file that matches the VC version of the PHP version you installed. In this example it is ImageMagick-7.0.7-11-vc15-x64.zip because we installed PHP php-7.3.28-Win32-VC15-x64.zip. Extract the file and then navigate to the bin folder (ImageMagick-7.0.7-11-vc15-x64\bin). Copy all the dll files except for ImageMagickObject.dll into the C:\Apache24\bin folder. Restart the Apache server using Apache Service Monitor.
WordPress also wants these extensions enabled in your PHP.ini file (C:\PHP\php.ini)
extension=exif (remove ;) extension=fileinfo (remove ;) extension=openssl (remove ;) extension=gd2 (remove ;)
Unlike your Web Development Server, your Hosting Service provider likely hosts hundreds of websites, and they will all have access to SQL databases. To keep track of who owns what database, and avoid duplicates, they will probably assign a database prefix for your domain. You can ask them what your prefix is, or you can go to your host provider’s cPanel->DATABASES->MySQL Database Wizard. In there it will show you the prefix name you have been assigned. Make note of that, as all of your Development Server databases and usernames will need to start with that prefix_ no matter what domain you are working on. For this tutorial, we are going to use examp_ as the prefix your Host provider has assigned.
Creating a WordPress Database
Start phpMyAdmin by typing localhost/phpmyadmin in your development server browser.
Set your collation to utfmb4_unicode_ci if it isn’t set to that already. Click on the Databases tab. Under Create database type in your prefix_domain. If you have a really long domain name use an abbreviated version that you will recognize. In this example, we are entering examp_example. Don’t add .com. Press Go and just like that you have an empty database.
Click on the House Icon under the phpMyAdmin title. A new series of tabs will appear. Click on User accounts, then New->Add user account. You will assign a top-level account here that will have full access to the database and be used by WordPress engine. You can be very cryptic in the name, or use something logical like examp_exampleadmin. Remember that the username needs to start with your account’s assigned prefix. Make sure that your password is cryptic! Use a combination of symbols, numbers and letters or use the Generate button. Make sure to record this password and username. Use the utfmb4_unicode_ci collation. Also change the Host name: to local and click the Global privileges option to Check all. Scroll down to the bottom and click on the Go button. You will now have assigned that user account as the full administrator of your database. You can verify that by clicking on your database to the left and looking at the Privileges tab. That’s all you need to do for setting up the database, WordPress will take it from here.
Installing WordPress Files
Go to WordPress.org and download the latest version of WordPress. It is worth noting that WordPress.org and WordPress.com are not the same things. Since we are using Windows we want a zipped archive rather than .tar.gz. Right-click on the WordPress download and choose to Extract all and uncompress the folder to htdocs. After it is uncompressed rename the wordpress folder it created to public_html if this is your primary site or if and add-on it would be example.com.
WordPress Initial Setup
Setting up WordPress is pretty straightforward. Make sure that you have your SQL database name, username and password handy. Make sure your Apache and MySQL modules are running and type in your domain name (example.com) in your browser. Select the language you want to use, and Let’s go! Then enter the values you used to create the database in phpMyAdmin. Leave the Table Prefix as wp_. Even if you have several sites, they each have their own table, so they can all use the same wp_ prefix.
If all went well you will connect to the database and move onto some general configuration. The Username will be the name you log into WordPress as administrator. Don’t use the same name and password you used for the database. This password should still be complex, but also something you can remember.
And just like that, you have a Development WordPress Site that will mimic a production site. Remember that to log into WordPress you will use example.com/wp-admin as the address in your browser. You will want to setup some basic settings right away. Click on Settings->General and change your Site Title and tagline. You may want to change your Site Language if you are not in the United States. It is a good idea to set your UTC to your time Zone, or the time zone where you expect most of your viewers to be in.
Under Writing you may want to setup Post via email if you have an active blog. Heed the warning about using a secret email account! I don’t use this option.
You need to decide whether you will let people comment on your posts and pages. This might seem like a good idea, but it can become a huge headache as people try and spam your site with inappropriate content. This is found under Settings->Discussion. Make sure you check the box Before a comment appears -> Comment must be manually approved. If you don’t I guarantee you will get spammed.
I don’t like people Commenting on my pages. My websites aren’t forums. If someone has a real issue with what I have said they can email me. To disable comments uncheck Default post settings -> Allow people to submit comments on new posts. Just in case a page comment post gets turned on by accident, I also check: Before a comment appears -> Comment must be manually approved and Before a comment appears -> Comment author must have a previously approved comment and Other comment settings -> Users must be registered and logged in to comment.
Once you have WordPress up and running, you need to change a few settings in your development environment. Locate your website folder. In this case, we used htdocs\public_html (or htdocs\example.com).
Open wp-config.php, scroll down to the wp-debug line and change it from false to true. This allows PHP errors and warnings to be displayed as you work on the site.
define( 'WP_DEBUG', false ); becomes define( 'WP_DEBUG', true );
If you have downloaded your site to work on it offline, you may see a cache option in the wp-config.php file. You want to disable caching so change it to false. If it isn’t in there do nothing.
define( 'WP_CACHE', true); becomes define( 'WP_CACHE', false );