locked
Installing PHP on IIS 8.0 RRS feed

  • Question

  • User-2066499958 posted

    Here is what my situation is:
    I have installed WebMatrix 3 from Web PI. From Web PI only when I try to download PHP 5.4.14 it stucks on 0. So I downloaded it manually. Now I have a PHP zip file (which I extracted at C:\PHP). I also have Visual Studio Express 2013 for Web. Visual Studio do not have PHP support (for free), WebMatrix has so I want to use Visual Studio for normal development and WebMatrix for PHP stuff. For PHP to run, I have to install it on IIS Express 8.0 that I got along with WebMatrix installation. What will be my steps to install PHP? Also, if you can help me with WebMatrix and Visual Studio problem then please suggest me something.

    Monday, October 28, 2013 8:14 AM

All replies

  • User-1315512054 posted

    Hello,

    You could read the following guide - how to host PHP on Windows.

    Regards

    Monday, October 28, 2013 3:30 PM
  • User-823319154 posted

    Hi Prashant

    We can activate IIS 8 in Windows 8 by using Turn Windows features on or off in Control Panel. And there are two way to install and configure PHP in Windows 8. First, we can install and configure PHP manually. Second, we can use Microsoft Web Platform Installer that can install and configure PHP automatically.

    Please refer 3 work in the section below :

     a. IIS 8 installation.

    b. Microsoft Web Platform Installer instalation.

    c. PHP installation and configuration with Microsoft Web Platform Installer.

    For reference: How to install and configure PHP on IIS 8 in Windows 8

    Regards

    Tuesday, October 29, 2013 2:22 AM
  • User-2066499958 posted

    I have asked for IIS Express 8.0 not IIS 8.0 as IIS Express is used by WebMatrix.

    Saturday, November 9, 2013 1:09 AM
  • User-355540640 posted

    For as far as I can see, there is no easy way to install and configure a custom PHP version with WebMatrix / IIS Express.

    You can set up PHP on your machine (for instance, follow http://www.saotn.org/php-54-wincache-on-iis-7-75-80/ to find out what to do with the .zip file), and according to http://stackoverflow.com/a/12946477/1297898 the applicationHost.config is located in %userprofile%\my documents\iisexpress\config\applicationhost.config (I just verified this). Following the documentation (http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme) you can use Appcmd.exe.

    So perhaps you can piece the information together to install your own PHP with WebMatrix / IIS Express?

    I just might make a guide about this topic sometime this weekend :)

    Regards,
    Jan

    Friday, May 23, 2014 7:36 AM
  • User-355540640 posted

    I know this is an old thread/question. I finally took some time to describe how to install your custom PHP version with IIS Express and WebMatrix 3. You can find the how to here:

    http://www.saotn.org/webmatrix3-own-php-configuration-iis-express/

    Hope this helps.

    Tuesday, August 19, 2014 5:11 AM
  • User1713535270 posted

    I suggest you to install only PHP 5.4.x from WebPI. If you wish to install it manually I suggest you to use IIS instead of IIS Express.

    Tuesday, September 23, 2014 2:22 AM
  • User-1034268908 posted

    Angie, this is close to what I'm running into.  Since posting this I found a video at https://www.youtube.com/watch?v=FFUhsVGXbWA that explains some things.  I tried to run the basic project and the install of what's needed to update IIS failed.  So it seems it's an IIS issue, for the internal IIS in VS 2013, which is IIS 8.

    If the image insert actually worked I could provide the install error I'm getting.  I have it saved locally as a png file.

    However ... I want to learn how to fix this.  The JS code calling the PHP file and the content of the PHP file is included.

    I have VS 2013 and am browsing an aspx page in Chrome from it.  It uses IIS 8 internally in order to do this.  PHP Tools for VS is installed and activated for 30 days.  My guess is IIS 8 in VS 2013 didn't respect this.

    This JS method is calling a php file in the same directory where jQuery lives.  The php text follows it.  Note, I'm getting an error on the closing ?> 'XML document must contain a root level element' so the file is still being seen as something other than php.  It is obviously called json.php.

    My guess is the install of PHP tools was not respected by IIS in VS 2013.  Whatever the issue is, how can this be fixed?  Thanks! Mike

    <script type="text/javascript" >
    $(document).ready(function ()
    {
    alert('in doc ready');
    $.ajax({
    type: 'GET'
    , url: 'json.php'
    , dataType: 'json'
    , success: 'showStates'
    , error: errorFunction
    });
    // for 28 Jul ... why are we getting an error, also the statusMessage is blank.  We should get xhr, statusMessage, httpErrorCode from JS.
    function errorFunction(xhr, statusMessage, httpErrorCode)
    {
    alert('An error was encountered ' + statusMessage);
    }
    function showStates(data, status)
    {
    alert('at show states');
    $each(data, function (item)
    {
    alert('in the loop to get states');
    $('#states').append('div' + data[item] + '</div>');
    });
    }
    });
    </script>

    PHP File Contents:

    <?php

    $states = array(
    "Wisconsin",
    "California",
    "Colorado",
    "Illinois",
    "Minnesota",
    "Oregon",
    "Washington",
    "New York",
    "New Jersey",
    "Nevada",
    "Alabama",
    "Tennessee",
    "Iowa",
    "Michigan"
    );

    print json_encode($states);

    ?>

    Tuesday, July 28, 2015 8:26 AM