Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Install PHP on IIS in Windows 7

Steps for configuring PHP to work with IIS in Windows 7

Follow all the steps for installing PHP manually on your Windows 7 system, before you configure php to work with IIS.

Prerequisite

Make Sure that you have IIS up and running with ISAPI Filter installed.

Configuring PHP:

1. Click on Start, in the Search programs and files type "inetmgr" and press Enter. Internet Information Management window opens, Now double click on Handler mappings.

iis handler mappings

2. Now click on the Add script map.

src="install-php-on-iis-in-windows-7_iis2.png" alt="iis2" />

3. In the Add Script Map window, add *.php in the Request path, click the button next to Executable and select php5isapi.dll file from php installation folder (i.e. D:\php, if you have installed php on D), add a name like php in Name field and click OK.

iis3

4. Go back to the  previous screen of Internet Information Manager by click on the blue arrow on the left corner of the screen.

iis4

5. On this screen, double click on the ISAPI Filters.

iis5

6. Click on Add on the next screen.

iis6

7. Add *.php  in the Filter name and select php5isapi.dll from the php installation folder by clicking on the button next to the Executable field.

8. Click OK.

iis8

9. Testing if PHP is installed properly.

Create a php file containing code <?php echo phpinfo(); ?> and save it as test.php.

Run this file on your web server and if you get an output like this :

test info

then your php installation is working properly on IIS in Windows 7.

A similar process can be followed for configuring PHP to work with IIS on Windows XP.

Previous: Install php on Linux
Next: Install PHP on Apache in Windows



PHP: Tips of the Day

How to Sort Multi-dimensional Array by Value?

Try a usort, If you are still on PHP 5.2 or earlier, you'll have to define a sorting function first:

Example:

function sortByOrder($a, $b) {
    return $a['order'] - $b['order'];
}

usort($myArray, 'sortByOrder');

Starting in PHP 5.3, you can use an anonymous function:

usort($myArray, function($a, $b) {
    return $a['order'] - $b['order'];
});

And finally with PHP 7 you can use the spaceship operator:

usort($myArray, function($a, $b) {
    return $a['order'] <=> $b['order'];
});

To extend this to multi-dimensional sorting, reference the second/third sorting elements if the first is zero - best explained below. You can also use this for sorting on sub-elements.

usort($myArray, function($a, $b) {
    $retval = $a['order'] <=> $b['order'];
    if ($retval == 0) {
        $retval = $a['suborder'] <=> $b['suborder'];
        if ($retval == 0) {
            $retval = $a['details']['subsuborder'] <=> $b['details']['subsuborder'];
        }
    }
    return $retval;
});

If you need to retain key associations, use uasort() - see comparison of array sorting functions in the manual

Ref : https://bit.ly/3i77vCC