Yuav Ua Li Cas Kom Php

Cov txheej txheem:

Yuav Ua Li Cas Kom Php
Yuav Ua Li Cas Kom Php

Video: Yuav Ua Li Cas Kom Php

Video: Yuav Ua Li Cas Kom Php
Video: Yuav ua li cas By Nhia Lor [full version] 2024, Kaum ib hlis
Anonim

Tsim cov ntaub ntawv PHP yog qhov yooj yim, thaum teeb tsa tus txhais lus los khiav nws tsis yog ib txoj haujlwm yooj yim. Txhawm rau khiav cov ntaub ntawv, koj yuav tsum tsim lub virtual server ntawm koj lub computer nrog PHP module ntsia.

PHP code
PHP code

Tsim nyog

Apache thiab PHP faib tawm

Cov Lus Qhia

Kauj ruam 1

PHP yog qhov lug siv server-sab ua ke cov lus. Cov ntawv sau rau ntawm nws yog tua thaum nkag mus ncaj qha rau ntawm lub server. Qhov no ua rau nws nyuaj rau nws khiav ntawm lub koos pij tawj hauv tsev rau kev debugging, yog li tshwj xeeb virtual servers siv.

Nto moo tshaj plaws thiab pheej yig virtual neeg rau zaub mov yog Apache. Feem ntau cov neeg siv thiab cov programmer muaj nws, nws siv rau ntau lub servers. Nws cov installation tau yooj yim thiab ntau yam qauv tuaj yeem txuas tau yooj yim rau nws.

Txhawm rau nruab Apache, koj yuav tsum xub rub nws los ntawm lub vev xaib raug cai, thiab khiav lub nruab download mus. Thaum qhia tseeb txoj kev teeb tsa, xaiv "C: /Apache2.2". Lub npe ntawm tus neeg rau zaub mov thiab chaw sau yuav tsum tau hais tawm ntawm koj qhov kev txiav txim siab, koj tuaj yeem tawm lub neej ntawd "kev xeem". Tom qab kev teeb tsa, Apache kev pabcuam pib ua haujlwm. Tus neeg rau zaub mov npaj nkag mus. Koj tuaj yeem tswj cov kev xa tawm los ntawm "Cov Kev Pabcuam" nyob rau hauv Windows ("Pawg Tswj Xyuas" - "Cov Thawj Tswj Xyuas" - "Kev pabcuam"). Txhawm rau tshuaj xyuas cov haujlwm server, lub chaw nyob hauv localhost raug ntaus rau hauv qhov chaw nyob ntawm tus browser. Yog tias "Nws ua haujlwm" raug tso tawm kom pom, tom qab ntawd txhua yam raug teeb tsa kom raug, thiab koj tuaj yeem pib txuas cov qauv tsim nyog.

Kauj ruam 2

PHP tau rub tawm los ntawm cov vev xaib raug cai. Cov ntawv tso tawm uas rub tawm tsis ua tiav rau hauv cov ntawv yuav tsum muaj (tshwj xeeb hauv "C: / php"). PHP yog ntsia. Tam sim no nws xav tau txuas rau Apache.

Kauj ruam 3

Rau qhov no, Apache teeb tsa cov ntaub ntawv qhib ("conf" nplaub tshev, "httpd.conf" cov ntaub ntawv hauv "C: /Apache2.2" nplaub tshev), thiab cov hloov pauv tau ua rau cov lus ntwm coj ua (cov lus cim tawm raug tshem tawm los ntawm cov kab sib xws):

AddType thov / x-httpd-php phtml php

LoadModule php5_module c: /php/php5apache2.dll

PHP installation yog npaj txhij, cia li rov pib dua lub server thiab pib sim ntawm koj tus kheej cov ntawv sau.

Pom zoo: