Heim  >  Artikel  >  Backend-Entwicklung  >  Umgebungsaufbau und -konfiguration für die mobile PHP-Internetentwicklung

Umgebungsaufbau und -konfiguration für die mobile PHP-Internetentwicklung

巴扎黑
巴扎黑Original
2017-03-19 09:29:181210Durchsuche

[Einführung] 1. Grundlegender Prozess der PHP5 4-Umgebungsanpassung an Apache: Webdienstanbieter. Offizielle Website: www apache orgPHP: Offizielle Website: www php netMysql: Offizielle Website: www mysql com 2. Software-Download Apache-Download-Adresse: http: download csdn net detail lxq_xsyu 7057423PHP

Apache:Webdienstanbieter wer. Offizielle Website: www.apache.org

PHP: Offizielle Website: www.php.net

Mysql: Offizielle Website: www.mysql.com

Apache-Download-Adresse: http://download.csdn.net/detail/lxq_xsyu/7057423

PHP-Download-Adresse: http://download.csdn.net/detail/lxq_xsyu/7057401

Mysql-Download-Adresse: http://download.csdn.net/detail/lxq_xsyu/6468461

(1) Apache-Installation

Installation erfolgreich

(2) PHP5.4 entpacken

(3) Apaches httpd.conf-Datei konfigurieren

Apache-Installationsverzeichnis

    ServerRoot „D:/Apache Software Foundation“
  1. Listening-Port

    #Listen 12.34.56.78:80

    Höre 80
  1. Servername

    #ServerName www.meritit.com:80

  1. Dokumentstammverzeichnis

    DocumentRoot „D:/Apache Software Foundation/htdocs“

  1. Berechtigungsordner


  1. Index (Standardzugriff auf die Startseite)


  1. DirectoryIndex index.html



  1. Fehlerprotokoll

  2. ErrorLog „logs/error.log“

  3. Zugriffsprotokoll

CustomLog „logs/access.log“ allgemein

  1. Konfigurationsanalyse PHP

AddType application/x-compress .Z

  1. AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php


  1. Fehlertyp

  2. #ErrorDocument 500 „Der Server hat einen Fehler gemacht.“

  3. #ErrorDocument 404 /missing.html

# ErrorDocument 404 „/cgi-bin/missing_handler.pl“ com/subscription_


  1. Neue a.php


  2. phpinfo( );
  3. ?>



Sie können sehen, dass die PHP-Konfigurationsdatei nicht gefunden werden kann. Wir geben das PHP-Konfigurationsdateiverzeichnis in der Apache-Konfigurationsdatei an

  1. PHPIniDir "D:/php54"




  1. # Virtuelle Gastgeber


  2. Include conf/extra/httpd-vhosts.conf


Entfernen Sie den obigen Kommentar (öffnen Sie die Konfigurationsdatei des virtuellen Hosts)

Konfigurieren Sie zwei Sites in httpd-vhosts.conf wie folgt


  1. DocumentRoot „D:/Apache Software Foundation/a_com“ >


  2. Servername 127.0.0.2


  3. ServerAlias ​​​​www.dummy-host.meritit.com


  4. ErrorLog "logs/dummy-host .meritit.com-error.log"


  5. CustomLog "logs/dummy-host.meritit.com-access. log“ allgemein





  6. 🎜>


  7. DocumentRoot „D:/Apache Software Foundation/b_com“

  8. ServerName 127.0.0.3

  9. ErrorLog "logs/dummy -host2.meritit.com-error.log"

  10. CustomLog "logs/dummy-host2.meritit.com- access.log" allgemein


  11. Hinweis: Sobald ein virtueller Host konfiguriert ist, ist der zuvor konfigurierte DocumentRoot ungültig.

D:Apache Software Foundationa_coma.php


  1. echo „aaaaaa“;

  2. D:Apache Software Foundationb_comb.php


echo „bbbbbb“;
  1. Hinweis: Zum Ändern des Berechtigungsordnerverzeichnisses

  2. Zugriffsergebnisse:

  3. 1. Grundlegender Prozess des PHP5.4-Umgebungsabgleichs

  4. Apache: Webdienstanbieter. Offizielle Website: www.apache.org
  5. PHP: Offizielle Website: www.php.net

  6. Mysql: Offizielle Website: www.mysql.com

2. Software-Download

Apache-Download-Adresse: http://download.csdn.net/detail/lxq_xsyu/7057423

PHP-Download-Adresse: http://download.csdn.net/detail/lxq_xsyu/7057401

Mysql-Download-Adresse: http://download.csdn.net/detail/lxq_xsyu/6468461

3. Umgebungseinrichtung

(1) Apache-Installation

Installation erfolgreich

(2) PHP5.4 entpacken

(3) Konfigurieren Sie die httpd.conf-Datei von Apache

Apache-Installationsverzeichnis

  1. ServerRoot „D:/Apache Software Foundation“


Abhörport

  1. #Listen 12.34.56.78:80


  1. Hören Sie 80


PHP-Komponente laden

  1. LoadModule php5_module "D:/php54/php5apache2_2.dll"


Servername

  1. #ServerName www.meritit.com:80


Dateistammverzeichnis

  1. DocumentRoot „D:/Apache Software Foundation/htdocs“


Berechtigungsordner

  1. Index (Standardzugriff auf die Startseite)

>

  1. Fehlerprotokoll


  2. ErrorLog „logs/error.log“

  3. Zugriffsprotokoll
  4. CustomLog „logs/access.log“ allgemein

    Konfigurieren Sie das Parsing von PHP

  1. AddType application/x-compress .Z


    AddType application/x-gzip .gz .tgz

  1. AddType application/x-httpd-php .php

  1. Fehlertyp


  2. #ErrorDocument 500 „Der Server hat einen Fehler gemacht.“

  3. #ErrorDocument 404 /missing.html

  4. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"

  1. #ErrorDocument 402 http://www.meritit.com/subscription_


  2. 4. Testen Sie, ob die Konstruktion erfolgreich ist

  3. Erstellen Sie eine.php



  4. phpinfo();

?>

Sie können sehen, dass die PHP-Konfigurationsdatei nicht gefunden werden kann. Wir geben das Verzeichnis der PHP-Konfigurationsdatei in der Apache-Konfigurationsdatei an

  1. PHPIniDir "D:/php54"


  2. 5. Konfigurieren Sie den Multi-Site-Zugriff


# Virtuelle Hosts

    Include conf/extra/httpd-vhosts.conf

  1. Entfernen Sie den obigen Kommentar (öffnen Sie die Konfigurationsdatei des virtuellen Hosts)
Konfigurieren Sie zwei Sites in httpd-vhosts.conf wie folgt

Foundation/a_com"

  1. Servername 127.0. 0,2


  2. ServerAlias ​​​​www.dummy-host.meritit.com


ErrorLog „logs/dummy-host.meritit.com-error.log“

  1. CustomLog „logs/dummy-host.meritit.com-access.log“ allgemein



  2. "D:/Apache Software Foundation/b_com"


  3. ServerName 127.0.0.3

  4. ErrorLog " logs/dummy-host2.meritit.com-error.log"

  5. CustomLog "logs/dummy-host2.meritit .com-access.log“ allgemein



  6. Hinweis: Sobald ein virtueller Host konfiguriert ist, ist der zuvor konfigurierte DocumentRoot ungültig.

  7. D:Apache Software Foundationa_coma.php
  8. echo "aaaaaa"; >


  9. ?> D:Apache Software Foundationb_comb.php


  10. echo „bbbbbb“;
  11. Hinweis: Sie müssen das Berechtigungsordnerverzeichnis ändern

    Besuchsergebnisse:


  12. Das obige ist der detaillierte Inhalt vonUmgebungsaufbau und -konfiguration für die mobile PHP-Internetentwicklung. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

    Stellungnahme:
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn