dpgua04022 2016-01-14 20:30
浏览 31

使用IIS在Windows上安装PHP

How can I install PHP on a Windows machine using Internet Information Services (IIS)?

  • 写回答

1条回答 默认 最新

  • douchongzhang9267 2016-01-14 20:30
    关注

    This is more a guide than a question in the hope it helps many users who are looking for an easy beginner's proof installation guide:

    First of all you need to have installed and running IIS on your machine, IIS doesn't comes by default, you have to add the characteristic from control panel -> Programs -> Windows Characteristics.

    I had successfully installed PHP under IIS 5.1 (WinXP), IIS 7.5.7x (Win7) and IIS 10.0.10x (Windows 10) both x32 and x64 platforms and works great.

    I resumed this guide in 10 easy steps:

    1. Download the PHP version you like from http://windows.php.net/download/ make sure you download the Non-Thread Safe (NTS) versions of PHP.
    2. Extract the files into 'C:\PHP\'.
    3. Open then 'Internet Information Services Administrator IIS'.
    4. Select the root item in the left panel.
    5. Double click on 'Handler Mappings' (Asignaciones de Controlador).
    6. On the right side panel click on 'Add Module Mapping' (Agregar asignacion de modulo..).
    7. Setup the values like this:

      Request Path: *.php Module: FastCgiModule Executable: C:\PHP\php-cgi.exe Name: PHP_FastCGI Request Restrictions: Folder or File, All Verbs, Access: Script

    8. Install 'vcredist_x64.exe' o 'vcredist_x86.exe' (Visual C++ 2012 Redistributable) https://www.microsoft.com/en-US/download/details.aspx?id=30679

    9. Setup your 'C:\PHP\php.ini', especially set the 'extension_dir ="C:\PHP\ext"'.

    10. Reset Internet Information Services: In a command console type IISRESET.

    Congratulations you have now PHP working on Windows!

    Optionally you can install the 'PHP Manager for IIS' https://phpmanager.codeplex.com/ which is of great help to setup the ini file and track the log of errors (sadly It doesn't works on Win10 as far i know).

    Remember to set 'index.php' as one of the default documents for IIS.

    Glad to help.

    评论

报告相同问题?

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch