Installing PHP (Personal Home Page) on Windows Cloud Servers

2019-12-19 By Aaron 4860 Views windows php development
60 reviews

PHP is the most popular open-source general-purpose scripting language in this World. The main use of PHP is creating forums, picture galleries, check details from a form, etc.


The main advantage of PHP is that it can easily be run on various platforms. See the instructions for installing PHP, changing PHP settings and enabling PHP extension on Windows IIS below.


Install PHP on Windows Cloud Servers (Using Web Platform Installer)


  1. Install the extension in IIS, please download this by visiting https://www.microsoft.com/web/downloads/platform.aspx.

  2. Then click Install this extension.

    windowsphp1

  3. Proceed with the Installation of extension after accepting the terms & conditions.

    windowsphp2

  4. Open IIS and verify the Web Platform installation Extension showing under Management section.

    windowsphp3

  5. Click Web Platform Installer icon under the Management section and search for the PHP version you need to install in the search box.

    windowsphp4

  6. Click Add button against the required PHP version.

    windowsphp5

  7. Then click Install button to install the PHP (E.g. PHP 7.2.19).

    windowsphp6

  8. Click Accept for the installation.

    windowsphp7

  9. Once installation is completed, click Exit button to exit from Web Platform Installer.

    windowsphp8

  10. Verify PHP handlers which showing under Handler Mapping section.

    windowsphp9

    windowsphp10

  11. Verify PHP installation by accessing the PHP info page by placing a PHP file under any website in the server or under the default website document root.

    For this, create a new text file named info.txt and type in the below content.

    Once the file has been saved, rename the file extension to PHP, thereby, changing the file name to info.php.

    windowsphp11

    This info.php file can now be browsed using any browser using the website name under which the file is created or using the server IP address or localhost if the file is created in the default website document directory and the existing PHP version and its settings can be viewed.

    http://websitename/info.php (replace `websitename` with the name of the website)
    (or)
    http://123.123.123.123/info.php (replace `123.123.123.123` with the server IP address)
    (or)
    http://localhost/info.php
    

    windowsphp12


Change PHP Settings on Windows Cloud Servers


  1. Open the directory under which the phpinfo file is to be created.

    windowsphp13

  2. Create the file with the phpinfo function using any editor of your choice.

    windowsphp14

  3. The file, info.php can now be browsed using any browser and the existing PHP version and its settings can be viewed. A general example of the phpinfo page is as shown below:

    windowsphp15

    The file displayed to the right side of Loaded Configuration File is the PHP configuration file in which the PHP settings need to be changed.

  4. Open the PHP configuration file using any editor of your choice and make necessary changes to the PHP settings as per your requirement.

    For example, if you require to increase the maximum size of files that you need to upload through your PHP application, the variables that need to be adjusted are post_max_size and upload_max_filesize. The existing values of both these variables can be found in the php.ini file.

    windowsphp16

    windowsphp17

  5. Modify these values according to your requirement in the PHP configuration file, save the file.

    Some other common PHP values that often require adjustment are the PHP memory limit and PHP execution time, denoted by the variable’s memory_limit and max_execution_time respectively.


Enable PHP extension on Windows Cloud Servers

The core functionality of PHP is PHP modules/ extensions. It helps to enable specific functions to be used in the PHP code.


The below steps can be followed for enabling required PHP extensions in the server.

  1. Check for the path of the PHP configuration file in your server. This value can be found out on the PHP info page.

    windowsphp18

    Here Loaded Configuration File of PHP is C:\Program Files\PHP\v7.2\php.ini.

  2. Open the Loaded Configuration File of PHP in any editor of your choice and make necessary changes to the file to enable the extension.

    For example, to enable PHP pdo_mysql extension, find the relevant part in the PHP configuration file for this extension, as below:

    windowsphp19

    Remove the semicolon( ; ) to uncomment the extension and save the file.

    windowsphp20

  3. Restart IIS service.

    Open service manager from Control Panel >> System and Security > Administrative Tools.

    windowsphp21

    Right-click the service World Wide Web Publishing Service >> then click Restart.

    windowsphp22

  4. To verify that the PHP extension has been enabled, load the PHP info file and search for pdo_mysql.

    windowsphp23

What do you think about this article?

Rate this article
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.