php example and environmental structures apache

A, apache installation configuration:

  1. Install apache

    1.1 Download: https: //www.apachelounge.com/download/

    1.2 unzip the downloaded file to the directory you want to install D: \ WAMP

  2.配置apache(D:\WAMP\Apache24\conf\httpd.conf)

    2.1 modify the ServerRoot (server path) to install directory apache ServerRoot "D: / WAMP / Apache24"

    2.2 modify the ServerName (Server Name) #ServerName www.example.com:80 This is the Apache server address, in front of the "#" removed, the "www.example.com" into "localhost"

    2.3 modify the DocumentRoot (root of the site) DocumentRoot "c: / Apache24 / htdocs" changed to D: / WAMP / Apache24 / www also modify the htdocs folder name is www

    Modifying at 2.4 DocumentRoot <Directory "c: / Apache24 / htdocs"> into <Directory "D: / WAMP / Apache24 / www">

    2.5 modify ScriptAlias ​​/ cgi-bin / "c: / Apache24 / cgi-bin /" is ScriptAlias ​​/ cgi-bin / "D: / WAMP / Apache24 / cgi-bin /"

    2.6 修改 <Directory "c:/Apache24/cgi-bin"> 为<Directory "D:/WAMP/Apache24/cgi-bin">

  3. Registration and unloading apache service

    3.1 Registration Service

      Running start ---- ----- cmd, enter apapche the bin directory, execute the command: httpd.exe -k install -n "Apache24"

    3.2 Uninstall service (must first stop the service)

      Running start ---- ----- cmd, enter apapche the bin directory, execute the command: httpd.exe -k uninstall -n "Apache24"

Two, php installation configuration:

  1. Install php

    1.1 Download: http: //php.net/downloads.php

    1.2 unzip the downloaded zip file to the specified directory, for example, extract it to D: \ WAMP \ php7.2

  2. Configure php (D: \ WAMP \ Apache24 \ conf \ httpd.conf)

    2.1 Configuration httpd.conf

      2.1.1 Adding PHP module

        Find "Dynamic Shared Object (DSO) Support" part. Probably in the vicinity of 62 lines. And finally adding the following code:

        LoadModule php7_module D:/WAMP/php7.2/php7apache2_4.dll

      2.1.2 Adding extensions

        Find a part of the "AddType" is. Probably in the vicinity of 409 lines, and follows the existing code added to the end:

        AddType application/x-httpd-php .php

        AddType application/x-httpd-php-source .phps

      2.1.3 Specifying php.ini configuration file path

        PHP httpd.conf file specified in the configuration file php.ini directory, where the positioning is not the end httpd.conf file, add the following code rearmost line of text:

        PHPIniDir "D: /WAMP/php7.2" (where "D: /WAMP/php7.2" actual path to the php.ini file storage)

      2.1.4 Configuration DirectoryIndex

        Find "DirectoryIndex" parts, probably in the 282 line, added in the back of a DirectoryIndex "index.php"

Guess you like

Origin www.cnblogs.com/weihexinCode/p/12432202.html