Apache Installation on Windows(Apache 2.4, PHP7)

For Web Developers, one of the requirements for testing web application is having a web server. Apache is one the popular Web Server used for most Web Server. The Apache HTTP server is an open-source Web server application developed by the Apache Software Foundation. The server software is freely distributed, and the open source license means users can edit the underlying code to tweak performance and contribute to the future development of the program.

In this article, I will show you steps on how to install Apache Server on Windows Machine.

How to install Apache 2.4 and PHP 7?

Let’s start:

To get started, download necessary files for this installation.

1. After you download Apache zip files extract the files into your root directory C:/Apache24.

Apache Installation on Windows

2 . Navigate to your Apache directory C:/Apache24/Conf and open file httpd.conf.

Apache Installation on Windows

3. Find and replace the following line below from httpd.conf file.

4. Register Apache Service using a command prompt. Change the CMD directory to C:\Apache24/bin

Apache Installation on Windows

Then, execute command httpd –k install . To install  Apache to your local machine.

Apache Installation on Windows

5. Verify Apache installation using services.msc. Open run command and type services.msc.

Apache Installation on Windows

Services window will open. Search for Apache2.4 service. If it looks like the image below then you have successfully installed Apache and it is already running.

Apache Installation on Windows

6. Create an index.html file inside folder C:\Apache24\htdocs.

Apache Installation on Windows

Run localhost:8080 from your browser to check if it is working.

Apache Installation on Windows

PHP Installation (7.0.13)

To complete Apache Server we also need to install PHP. In my case, I used PHP version 7.0.13. I assume you have already downloaded the files using the link from the beginning of this post.

Apache Installation on Windows

Let’s Start:

1.  Extract the PHP zip files to your root directory which is C://.

Apache Installation on Windows

2. Now open PHP folder and locate files naming Php.ini – development. Rename it to Php.ini

Apache Installation on Windows

3. Open Php.ini files and remove the semicolon to uncomment the lines of code shown below. This will load PHP extensions you need for your development server.

  • extension=msql.dll
  • extension=php_curl.dll
  • extension=php_ftp.dll
  • extension=php_mysqli.dll
  • extension=php_openssl.dll
  • extension=php_pdo_mysql.dll

4. To integrate Php to Apache open httpd.conf from you Apache folder(C:\Apache24\C:\Apache24\conf).Find and replace the lines shown below and make sure that the directory is pointing to your PHP folder(C:/Php).

5. Restart Apache using httpd –k restart.

Apache Installation on Windows

Check if PHP is working.

Open index.html from C:\Apache24\htdocs and modify code using the line below.

Open your browser and run localhost:8080 to see if it echoed the word hello world.

Apache Installation on Windows

And we are done. Hope this help!

Happy Coding!!

How to enable Internet Information Service (IIS) – Windows 10

What Is IIS?

It is a Web Server software created by Microsoft which is designed for hosting websites.  It can be used in a standard Html page and dynamic pages like PHP pages and ASP.NET applications.To dig deeper with the definition of IIS and its history you can refer to Wikipedia.org for full details.

If you are working in a project and you want to show your progress to one of your team member in a network you might need to use IIS. Below are instructions on how to enable IIS on Windows 10.

Let’s Start:

  1. Go to your control panel. You can use start Menu then search for Control Panel then select Control panel from the search result. Use the image below for your reference.

    Start Menu

  2. You can also use Run by holding window button from your keyboard and pressing R key then type keyword Control Panel.

    CTRL + R

  3. In the Control Panel Window select Uninstall program.

    Control Panel

  4. From the Installed Updates window click on the Turn Windows feature on or off link from the left pane.

    Installed Update

  5. Windows feature window should pop-up, scroll down and search for Internet Information Services (IIS).Expand Internet Information Services and select option as shown in the image below.

    Windows Feature

  6. Wait for windows to enable your Local IIS.

    Enabling IIS

  7. To verify if  it is successfully enable, go to start menu and type IIS and select Internet information Services (IIS) as the image shown below.

    Search for IIS

  8. Internet Information Services (IIS) Manager.

    IIS Manager Dashboard

You’re done! Your Internet Information Service or IIS is successfully enabled. You can now start hosting your ASP.Net Web Applications from your local IIS.


Post you may like:

 

[pt_view id=”2384ae03it”]