Table of Contents
What is PHP?
PHP in IIS – PHP was originally an acronym for personal home page, but now it’s short for PHP: Hypertext Processor.
PHP is a programming language used for web development. It’s also used as the name for the underlying engine that runs that application. Usually, this is the Zend Engine. Even though alternatives exist, the Zend Engine is the standard implementation and the only one regarded as “feature complete.”
The Zend Engine interprets the PHP code and compiles it on-the-fly to a format it can execute. This might seem inefficient, and it would be if the engine had to do so for every request, but some smart people have created optimizations as sufficient workarounds for most use cases. Incidentally, we will look at one such solution in this article. The advantages of PHP (like a great community and fast results) greatly outweigh the possible performance drawback most users won’t notice.
What is IIS?
IIS (Internet Information Services) is Microsoft’s web server and has been around since 1995. The latest version, IIS 10, comes bundled with Windows and as such, IIS is a free product.
There is a lightweight version of IIS called IIS Express that can be installed separately, but is intended for development purposes only. IIS Express only supports HTTP and HTTPS protocols and by default, merely supports local requests. In this article, I will be using the full version of IIS 10.
Since version 7, IIS has had a modular architecture, allowing us to add only the functionality we need. IIS 10 added support for HTTP/2, HSTS, and containers. IIS is the third most popular web server (after Apache and Nginx), running about 8.7% of all websites.
Reasons to run PHP in IIS
The majority of PHP applications use the Apache or Nginx web servers, although there are good reasons to use IIS instead:
→ IIS knowledge among your system engineers is more extensive.
→ Your agreement with Microsoft for support is excellent.
→ You must use either ASP.NET or traditional ASP apps.
→ You must work on PHP solutions in addition to developing Windows-only solutions locally on IIS.
→ Other Windows services like Active Directory, Windows file sharing, or Microsoft Exchange must be integrated.
IIS can only be used on Windows, although running PHP on IIS differs from running PHP on Windows. Windows users have the option of running PHP via XAMPP or WampServer. However, these two alternatives provide you some further possibilities to consider. They employ MySQL or MariaDB as a database server and Apache as a web server.
Your needs might not be met by this. It’s a good idea to run your PHP websites under IIS if you already have websites operating there. They are all together in this manner. You could even wish to employ a different database technology. Or you prefer the reliability of a solution provided by the big company that Microsoft is. You’ll find that it isn’t all that difficult when we look at installing PHP in IIS.
Installing PHP in IIS
Follow the following steps to install PHP in IIS:
Step 1: At first, the IIS Manager Home page should be opened. There is an option Web Platform Installer will present. That should be clicked.
Step 2: Wait for some time till the Installer is starting. It will take some time.
Step 3: After that, a list of software will be available. From there proper PHP version should be chosen. There will be many PHP versions available. Among them, one should be added. Click on the Add button to add that software.
Step 4: After clicking on Add button, at the bottom of the page, one Install button will be enabled. Click on it, it will install the PHP.
Step 5: Then one new window will be opened. There click on Accept button. Along with PHP, it will also install some prerequisites for running PHP in IIS.
Step 6: After that, the installation will start. It will take a lot of time. Wait till the installation is completed.
Step 7: After successful installation, the Web Platform Installer will start again. Wait for some time to complete the configuration.
Step 8: Then again the complete list will be visible. If the PHP version is searched, it will be marked as Installed. Hence, PHP is installed successfully in IIS.