Home >Backend Development >PHP Tutorial >Build a php environment under window

Build a php environment under window

不言
不言Original
2018-04-20 10:07:373867browse

The content of this article is about building a php environment under window. It has certain reference value. Now I share it with everyone. Friends in need can refer to

The download address and order of independent installation of each module :

  • Apache

  • PHP

  • MySQL


Install Apache:

  • Download apache, select ApacheHaus (convenient for debugging);

  • Select the corresponding operating system, 32-bit or 64-bit;

  • Create a new folder named phpenv on the D drive D:\phpenv \, unzip the downloaded compressed package to this folder (for easy management)

  • Modifyhttpd.confLet serverRoot point to the installation file

  Define SRVROOT "D:/phpenv/Apache24"
  • Enter the installation command

    D:\phpenv\Apache24\bin>httpd -k install
  • Enter the startup command

    D:\phpenv\Apache24\bin>httpd -k start
  • Test whether apache is installed success. Enter http://localhost in the browser, and when It works appears, you can write

  • to httpd.conf Enter the PHP support module

# PHP环境添加模块LoadModule php5_module "D:/phpenv/php-5.6.36/php5apache2_4.dll" //php-5.6.36 为php安装目录名PHPIniDir "D:/Program Files/wamp/php-5.6.36/php.ini"# 添加PHP支持AddType application/x-httpd-php .php#添加首页文件类型支持<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
</IfModule>

Install PHP

  • Download php and select Thread Safe version of PHP, unzip it to D:\phpenv\php-5.6.36\

  • and copy the php.ini-production file Name it php.ini, and enter the file to change ; extension_dir = "./" to extension_dir = "D:/phpenv/php-5.6.12/ext"

    Open the following file (remove the preceding ;)

extension=php_curl.dllextension=php_gd2.dllextension=php_imap.dllextension=php_mbstring.dllextension=php_mysql.dllextension=php_mysqli.dllextension=php_pdo_mysql.dllextension=php_snmp.dllextension=php_soap.dllextension=php_sockets.dll
  • Verify that PHP is installed, enter on the command line: httpd -k restartRestart the service.
    Create a new file phpinfo.php in the D:\phpenv\Apache24\htdocs path, and add the content 1c54a2ccadef45a7573e3649bdfd6f57, and then enter http://localhost/phpinfo.php in the browser to test.


Some problems encountered when installing apache

1.

Errors reported here must be corrected before the service can be started.

(OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试。  : AH00072: make_sock: could not bind to address [::]:80(OS 10013)以一种访问权限不允许的方式做了一个访问套接字的尝试。  : AH00072: make_sock: could not bind to address 0.0.0.0:80AH00451: no listening sockets available, shutting down

AH00015: Unable to open logs

Cause: The port is occupied.

Method: Modify the Listen and ServerName port numbers in the Apache24\conf\httpd.conf file.

Set 80 to 8080 here


2.

Errors reported here must be corrected before the service can be started.

(OS 10048)通常每个套接字地址(协议/网络地址/端口)只允许使用一次。  : AH00072: make_sock: could not bind to address 0.0.0.0:443AH00451: no listening sockets available, shutting down

AH00015: Unable to open logs

Cause: The listening port is occupied. Since Skype is installed, opening Skype occupies port 443.

Method: Modify httpd-ahssl.conf and httpd-ssl.conf under Apache24\conf\extra.

Change 443 to 442 here.


Reference materials:

apache installation tutorial

apache error

Related recommendations:

## CentOS 7 builds a PHP server environment

Sublime Text3 builds a PHP development environment


The above is the detailed content of Build a php environment under window. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php csv exportNext article:php csv export