WordPress is a blog publishing application and content management system. The following sections describe how to install and configure WordPress for use with FastCGI on Internet Information Services 7 (IIS 7) and above. This document assumes that you have completed the setup and configuration of the FastCGI extension & PHP libraries. (Described in a later section of the document)
Also, make sure the Visual C++ Redistributable Packages are installed. The easiest way to install WordPress is by downloading it from the official site.
The following article provides guidance for installing WordPress manually. The instructions have been tested and found to work in the following configurations:
- Windows Server® 2012 operating system
- IIS 7
- PHP 7.2.3
- MySQL 8
- WordPress 5.6
PrerequisitesFrom the base default configuration file provided by PHP, modify the following lines in your Php.ini configuration:
- Define extension\_dir as c:\php\ext (for example, the location of your php extensions directory).
- Uncomment extension=php\_mysql.dll in the extensions list to enable MySQL support.
Download and Unpack the ApplicationFirst, download the latest stable release of WordPress. Uncompress the WordPress files and copy the files to C:\Inetpub\wwwroot\wordpress or another directory of your choosing. There is no need to modify permissions on the WordPress Web directory because the default permissions suffice.
Set Up the DatabaseBefore starting the installation procedure for WordPress, you must create a database on your server. Also create a user and grant this user "db ownership" permission to the database. This article uses the following database information:
- Database name: wordpress
- Database user: wordpress
- Account password: wordpress
Modify the Configuration FileModify the WordPress configuration file to connect to the database.
- 1. From Windows® Explorer, navigate to the installation directory C:\inetpub\wwwroot\wordpress, and rename the file wp-config-sample.php to wp-config.php.
2. Edit wp-config.php; change the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST values as follows:
Setup and Configure the Application
- 1. From Windows® Internet Explorer®, goto http://localhost/wordpress/wp-admin/install.php.
2. Type the name of your blog and your e-mail address, and then click Install WordPress.
Enable "Pretty Permalinks"Typically, WordPress users must use "almost pretty" URLs (for example, http://contoso.com/index.php/yyyy/mm/dd/post-name/). With the URL Rewrite module, you can create "Pretty Permalinks" (for example, http://example.com/year/month/day/post-name/) for WordPress blogs hosted on IIS.
The steps that follow assume that WordPress is installed in a Web site root directory. If WordPress is installed in a subdirectory, then the rewrite rules must be included in the web.config file located within the same subdirectory as the WordPress files.
- 1. Install URL Rewrite Go Live release.
2. Log on to WordPress as an administrator.
3. Click the Settings button.
4. Click the Permalinks tab for the Customize Permalink Structure page.
/%year%/%monthnum%/%day%/%postname%/ in the Custom Structure text box.
6. Click Save Changes. You will see that all the blog post links have URLs that follow the format you have specified; however, if you click any link, the Web server returns a 404 - File Not Found error, because WordPress relies on a URL rewriting capability within a server to rewrite requests that have "pretty permalinks" to an Index.php file.
Create Rewrite Rule
- 1. Open the web.config file (located in the same directory as the WordPress files). If you do not have a web.config file in the WordPress directory, create it.
2. Copy and paste the following XML section into the system.webServer element:
Test the Rewrite RuleAfter the rewrite rule is saved to the Web.config file, open a Web browser, and then click any one of the permalinks in WordPress blog. You should see the correct content returned by the Web server for every permalink.
Installing PHP and creating a new website in IIS
- 1. Download the required PHP version from the Thread Safe link.
Deployment on IIS
- 1. For deploying WordPress website on IIS , open the IIS App (Internet Information Services)
Create a new Website by clicking on Add Website and specify the Site name as shown below in the figure.
Installing additional features on Remote Server and Configuration
- 1. Go to the Server Manager and open the “Add Roles and Features” Wizard.
Install and Configure SendmailDownload the Sendmail from the related website.
Now extract the downloaded zip to the appropriate location and open the sendmail.ini file to configure the email server as shown below.
;Configure Sendmail [sendmail] ... smtp_server=An example to configure the Gmail is as shown below.
... smtp_port= ... auth_username= ... auth_password=
[sendmail] ... smtp_server=ssl://smtp.gmail.com ... smtp_port=465 ... email@example.com ... auth_password=password ;OR [sendmail] ... smtp_server=tls://smtp.gmail.com ... smtp_port=587 ... firstname.lastname@example.org ... auth_password=passwordNow save the file and close it to apply the changes. The settings might be different based on the email server or service provider.
Configure PHP for SendmailIn case you are using the secure ports 587 or 465, you might get an error in case the OpenSSL module is not enabled for PHP. Make sure OpenSSL module is enabled.
In order to configure PHP, open the php.ini file and update it as shown below.
;SMTP = localhost; ;smtp_port = 25; ... ... ;auth_username = ; ;auth_password = ; ... ... ;sendmail_from = email@example.com ... ... sendmail_path = C:\sendmail\sendmail.exe
Sample sendmail.ini file
smtp_server=smtp.gmail.com smtp_port=587 smtp_ssl=TLS error_logfile=error.log firstname.lastname@example.org auth_password=password hostname=localhost
Sample php.ini file
extension=openssl ;SMTP = localhost ;smtp_port = 25 ;sendmail_from = email@example.com sendmail_path = C:\sendmail\sendmail.exe
Send EmailIn this step, we will write the program to send an email using the configurations done by us in previous steps. Write a PHP program to send email as shown below.
<?php $from = "firstname.lastname@example.org"; $to = "email@example.com"; $subject = "Hello Sendmail"; $message = "This is an test email to test Sendmail. Please do not block my account."; $headers = [ "From: $from" ]; mail( $to, $subject, $message, implode( '\r\n', $headers ) ); // OR - PHP 7.2.0 or greater //mail( $to, $subject, $message, $headers );Also, check the error.log file in the Sendmail directory to check for errors. It might also generate a crash.txt file in case of any error.
What Oditek offers
Refer our Skills page:
We had a tough deadline to launch our .Net based application that processes a lot of data, and got very frustrated with our development agency we hired. Fortunately we got Oditek, and they took over seamlessly the product development, launched the app & continued feature development. Just awesome!
They were very attentive to our needs as clients and went out of the way to make sure our projects were taken care of. They were always able to get projects done in the specifications we requested. They are passionate about getting things done; I would definitely recommend them to lead any IT projects.
OdiTek has been very impressive in delivering a C++ based network security product migration from Linux to Windows. Honestly, we didn’t expect the speed and competencies to get the migration project delivered absolutely on time as the existing product was complex. Technically team is very experienced.
I worked with OdiTek on few high profile banking application projects. They did a fantastic job with web applications & manual testing on the VAS apps for two leading banks of UK that included rigorous UAT phases. I recommend them for any application development where security matters.
OdiTek is our extended team who works on our key software projects. They are dependable, good in collaboration and technically very much to the level what we expect a global team should be. They had transformed our web applications, CRM and added mobility to existing business platforms here.
It's been more than 4 years now that we are working with OdiTek on our cloud based web product development. It's been amazing working together, they are very competent on designing scalable, high performance apps. Their technical support is outstanding to say the least, even at odd hours.
I am a fan of Team OdiTek since 2014 and have worked on many product development projects together. Specially worth mentioning their deliveries on VAS Banking web application development & manual testing services for Smarta, UK. They are highly skilled & a professional team to work with.
OdiTek has been working on our Integrated Web-scale Mobile Platform i.e. Optimal Health since 2014. They are very professional and takes care of the requirements meticulously. They are technically very sound and sincere in ensuring quality & performance. Wonderful working with them!
You can trust the team, with minimum supervision you get the work done. They are honest, professional & committed to schedule & quality. I had been successfully running 3 business applications designed, developed and maintained by Oditek developers. It’s been a pleasure working with them.
OdiTek has been working in custom software development, including services for test automation. Many of them have worked with me in 2009-10 when I was R&D Manager in NetHawk India. They have great enthusiasm & a passion to excel in bringing customer success. Their work has been very impressive.
It's amazing to see these guys are turning their experience into a global delivery excellence at OdiTek. I am sure their past large scale product development experience will be handy to product companies. I would always recommend Oditek for software development, especially performance-driven solutions.