windows7+iis+php7+mysql5.7 Environment Construction

Source: Internet
Author: User
Tags windows x86 sublime text

IIS Configuration

The system used for this build is similar to windows7,windows8,10.

Turn on IIS

Start-up Control Panel--Programs and features, click on the left column 开启或关闭Windows功能 ,

Select Internet信息服务 and select the CGI inside.
Open the browser, enter localhost or 127.0.0.1 , you can open the Web page normally indicates that the open is successful.

New site
    1. Open IIS (available in Start menu search IIS Open), right click in the left column, 网站 select 添加网站 , fill in the following information:

Here the port is set to 5000 (avoid conflicts with other program ports). Last Click 确认 .

  1. In the left column of the IIS interface, select the site you just created, double-click the page 默认文档 , add a default document, name index.html it, and move to the top of the default document list
  2. In the physical path directory that you just filled out, create the file index.html and write some characters, such ashello world!
  3. Open the browser, enter the address bar localhost:5000 , as shown to hello world! indicate the success of the setup

    To set up LAN access, you can use the following methods: Method one: Directly shut down the firewall (not recommended); Method Two: Open the firewall and set the inbound rules, as follows: Control Panel->windows Firewall---Advanced settings, inbound rules, new rules, in the popup window 新建入站规则向导, rule type selection 端口 , next, protocol and port selection TCP , specific local port completion 5000 , Next, action selection 允许连接 , next, config file All tick, next, give the rule a name, click 完成 . Open cmd, enter to ipconfig view native intranet IP address, open browser, enter ip_address:5000 (ip_address Replace with your own IP) to test. (after Setup, edit Site Directory permissions, add IUSR account, have Modify and write permissions)

    PHP Installation
  4. Download the latest version of PHP, URL: https://windows.php.net/download/, note the system version, I use the system is Windows7 x64, here Select version: VC15 x64 Non Thread Safe . Unzip to the specified directory when the download is complete, such asD:\dev\PHP7

    The difference between TF and ntf version: TS (thread-safety), linear security, multi-threaded access, the use of locking mechanism, PHP when loading in ISAPI mode to select this version, NTS (None-thread safe) is non-thread-safe, PHP chooses this version when running in fast-cgi mode, with better performance.

  5. Download the PHP runtime Visual C + + runtime and install, URL: https://www.microsoft.com/en-gb/download/details.aspx?id=48145
  6. To configure PHP7 in IIS: Open IIS, double-click 处理程序映射 , click on the right column 添加模块映射 and fill in the information:

In the dialog box, click on the 请求限制... following settings:

Last click OK two times, configuration complete.

  1. Set default document: In IIS, select the site that you created earlier, double-click the page 默认文档 , set it up, add index.php and move to the top of the default document list.
  2. Test: At the site root, create file index.php, write <?php phpinfo(); ?> and save. Open the browser and enter localhost:5000 in the Address bar, which indicates that the configuration was successful.
  3. Configure php.ini: Copy the Php.ini-development or php.ini-production in the PHP directory and name php.ini it. Use the editor, such as Sublime Text open php.ini, make the following configuration and save (notice to remove the preceding semicolon):
    (1) Set the time zone:date.timezone = Asia/Hong_Kong
    (2) Set the extension file directory: extension_dir = "ext" (located at the back of the line ; On windows: )
    (3) Due to IIS, the following configuration is required to improve performance and security: cgi.force_redirect = 0 , cgi.fix_pathinfo=0 fastcgi.impersonate = 1 .

    MySQL Installation
  4. Download the latest version of MySQL, url: https://dev.mysql.com/downloads/mysql/, select the appropriate operating system and version here, select Windows X86-64bit,zip-archive, Click the download jump to download page, you can click No thanks, just start my download direct download, no need to register an account. Extract extracted to the specified directory, such as "D:\dev\mysql" after download is complete
  5. Start cmd as an administrator, and sequentially switch directories by executing the following command:

    D:cd dev/mysql/binmysqld --initialize --console

    You will be prompted to generate a temporary password, be sure to write down the password.
    In 3.CMD, perform the mysqld --install installation of MySQL into the Windows service, win-+r Open the Command Run window, run services.msc open Windows service, locate MySQL, start the type set to Automatic and start the service.

    Mysql.exe can be added to the environment variable, where you add D:\dev\mysql\bin to the environment variable without having to switch directories each time.

  6. Modify the default password: cmd to execute mysql -u root -p , enter the temporary password generated before logging in. Log in after execution alter user ‘root‘@‘localhost‘ identified by ‘your_password‘; (Your_password replaced with the password you want to set), perform the quit; exit, log in with the password you just set, and see if the login is successful.
  7. Support for configuring MYSQLI extensions in PHP.ini: add:extension=php_mysqli.dll
  8. Test: Edit the previously created index.php and change the code to:

    $result = mysqli_connect("localhost","root","your_password");if ($result) {echo "success!";}

    Replace the Your_password replacement with the MySQL password you set.
    Open the browser and enter localhost:5000, as shown in success!, indicating that PHP has successfully connected to MySQL.
    This is where the windows+iis+php7+mysql5.7 Web server is built.

windows7+iis+php7+mysql5.7 Environment Construction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.