Views: 4407
Last Modified: 18.03.2021

Before starting the installation, ensure that PHP is supported by your server.

  Installation

Execute the following actions to install PHP:

  • Download PHP version 7.2.0 and higher, provided in the archive. Released versions are available at the site http://www.php.net/downloads.php.
  • Unpack the downloaded archive. For example, into the folder х:\php\.

    Note: Documentation uses path as х:\, such path can be specific to a drive with installed Windows OS.

  • Rename the file php.ini-recommended into php.ini.
  • Copy the file php.ini into the directory x:\Windows.
  • Open the file php.ini for editing in test editor.

  • Find the string: extension_dir =

    and update it as follows: extension_dir = x:\php\extensions

  • Find the string: doc_root =

    and update it as follows: doc_root = "x:\Inetpub\wwwroot"

  • Find the string: cgi.force_redirect = 1

    and update it as follows: cgi.force_redirect = 0

  • Save the changes.
  • Copy the file php7ts.dll, located in the x:\php\ directory, into the directory x:\Windows\System32.
  • Go to the menu Start > Settings > Control Panel > Administrative Tools > Internet Information Services (IIS) Manager.
  • Click on your site in the Web Sites directory tree (in majority of cases it is designated as Default Web Site). To open the site property settings window, select the Properties item in the popup context menu.
  • Open the Home Directory tab.
  • Select the Scripts and Executables for the field with the Execute Permissions list in the Application settings section.
  • Then, click on the Configuration button in the same section (Application settings).
  • Go to the Mappings tab.

    Extensions config for the complete site within the Mapping tab allows using these extensions for all virtual directories, located at this site.

  • Click on the Add button to set the path to ISAPI DLL and indicate the php-module extension.
  • Complete the field of the opened form as follows:
    • Executable: use the Browse button to find executable php7isapi.dll library file or manually enter the string with address: x:\php\sapi\php7isapi.dll;
    • Extension: enter .php extension in the field;
    • Remove the flag in the Verify that file exists field. Set the flag only in the Script Engine field.
  • Click on OK button to save the new changes in each window.
  • Click on Web Service Extensions in the IIS directory tree. Select the Add a New Web service extension item in the displayed context window.
  • Click on the Add button in the Required file section to specify new filter name (.php) and the path to php7isapi.dll ISAPI-file. This file must be located in code>x:\php\sapi\php7isapi.dll.
  • Set flag in the field Set extension status Allowed.
  • Click on OK button.

To use the index.php page by default when loading site, proceed with the following actions:

  • Click on your site in the Web Sites directory tree. Select the item Properties in the appeared context menu.
  • Go to the Documents tab.
  • Click on the Add button.
  • It opens the Add content Page button. Enter the index.php page name in this window field.
  • Click on the OK button.
  • The index.php page will be located at the end of the list. By using the Move Up button, move the page to the start of the list.
  • Confirm the implemented settings by clicking on OK button.

Install IIS and relaunch it to implement the entered changes.

  Operation check

  • Create the file with name test.php.
  • Move the created file in the string
    <? phpinfo(); ?>
  • Move the file in your site root directory.
  • Open the specified http://localhost/test.php page in browser to check PHP operation.
  • The browser window must show table with PHP settings.



Courses developed by Bitrix24

 Start the course