Qhib cov ntaub ntawv php

Cov txheej txheem:

Qhib cov ntaub ntawv php
Qhib cov ntaub ntawv php
Anonim

PHP yog cov lus sau feem ntau siv los ntawm lub vev xaib tsim kom muaj cov ntsiab lus muaj zog, uas txhais tau tias cov ntsiab lus ntawm nplooj ntawv web tuaj yeem hloov pauv raws li cov kev txwv hauv PHP code. Qhov no tuaj yeem yooj yim xws li hloov tus neeg siv cov duab keeb kwm yav dhau los raws sijhawm. Lossis nws tuaj yeem nyuaj raws li tsim daim ntawv qhia ua haujlwm uas qhia cov neeg siv sib txawv lawv qhov kev thov raws qhov chaw uas lawv tab tom ua. Koj tuaj yeem yooj yim saib PHP cov ntaub ntawv ntawm ob lub Windows thiab Mac khoos phis tawj nrog tus lej code editor. Koj kuj tseem tuaj yeem sau cov ntaub ntawv PHP siv tus server koj them rau, lossis hauv koj lub computer nrog XAMPP. Nyeem rau hauv qab no rau ntau txoj hauv kev los ua qhov no.

Cov kauj ruam

Txoj Kev 1 ntawm 3: Qhib PHP cov ntaub ntawv hauv Windows

Qhib PHP Cov Ntaub Ntawv Kauj Ruam 1

Kauj Ruam 1. Rub tawm tus lej hloov kho yog tias koj tseem tsis tau muaj

Cov neeg kho cov cai yog cov haujlwm uas tso cai rau koj sau cov cai lossis sau cov lus. Tus kws kho kab lis kev cai txawv ntawm tus txheej txheem txheej txheem xws li Microsoft Word.

  • Cov kws kho kab lis kev cai tau nruab nrog cov chaw rau kev sau ntawv thiab nyeem ntau yam lus programming, xws li PHP.
  • Cov kws paub paub tus lej zoo yog Dreamweaver, Notepad ++, TextEdit thiab Komodo Edit.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 2

Kauj Ruam 2. Txhim kho tus lej editor

Thaum koj tau pom tus kws kho kab lis kev cai rau koj nyiam, koj tuaj yeem rub tawm thiab teeb tsa daim ntawv thov. Nrhiav cov ntawv.exe thiab qhib nws. Ua raws li cov lus qhia kev teeb tsa.

  • Thaum koj nyem rau rub tawm, koj kuj tseem tuaj yeem xaiv khiav cov ntawv teeb tsa tam sim thaum rub tawm. Nyem "Khiav" hauv lub qhov rai ruaj ntseg. Lub installer yuav khiav tau.
  • Thaum koj tau teeb tsa tus kws kho kab ntawv, koj tuaj yeem qhib nws thiab saib PHP cov ntaub ntawv nrog nws.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 3

Kauj Ruam 3. Txoj nyem rau ntawm PHP ntawv thiab xaiv 'Qhib nrog'

Tom qab ntawd xaiv tus kho qhov chaws qhib cov ntawv. Nyob ntawm qhov nrawm ntawm koj lub khoos phis tawj, nws yuav siv sijhawm me ntsis los qhib cov ntawv. Tus kws kho mob yuav pib thiab thauj cov ntaub ntawv PHP.

  • Yog tias tus khoos phis tawj tsis tshwm nyob rau hauv cov ntawv qhia zaub mov tshiab, nyem rau 'Xaiv qhov program tsis raug …' Yog tias koj qhov program tsis tshwm nyob rau ntawm lub vijtsam tshiab, nyem rau ntawm 'Xauj …' thiab nrhiav qhov chaw nyob qhov twg qhov program nyob ntawm koj khoos phis tawj raug teeb tsa. Qhov no tuaj yeem yog ntawm lub desktop. Nyem rau 'OK' thaum koj pom qhov program.
  • Thaum koj pom qhov haujlwm thiab nyem 'OK', PHP cov ntawv yuav qhib rau hauv cov ntawv sau. Tom qab ntawd koj tuaj yeem tshuaj xyuas cov cai thiab hloov pauv raws li xav tau.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 4

Kauj Ruam 4. Ua kom ntseeg tau tias tus khoos phis tawj yog lub hauv paus rau PHP cov ntaub ntawv

Txhawm rau ua kom yooj yim qhib PHP cov ntaub ntawv, koj tuaj yeem teeb tsa tus editor ua lub neej ntawd rau hom ntawv no yav tom ntej. Hloov daim ntawv thov rau koj cov ntaub ntawv PHP hauv nplooj ntawv teeb tsa ua ntej.

  • Mus rau Chaw> Hloov PC teeb tsa> Tshawb nrhiav & apps> teeb tsa tsis raug.
  • Nyem "Xaiv cov ntawv thov ua ntej los ntawm hom ntaub ntawv" lossis "Xaiv cov ntawv thov ua ntej los ntawm cov txheej txheem." Tom qab ntawv nyem rau ntawm daim ntawv thov, xws li Notepad ++, txhawm rau teeb tsa nws ua qhov haujlwm tsis raug.
  • Lub sijhawm tom ntej koj yuav tsum qhib PHP ntaub ntawv, tsuas yog ob npaug nias lub cim.

Txoj Kev 2 ntawm 3: Qhib PHP cov ntaub ntawv ntawm Mac

Qhib PHP Cov Ntaub Ntawv Kauj Ruam 5

Kauj Ruam 1. Rub daim ntawv thov qhib PHP cov ntaub ntawv ntawm koj Mac

TextWrangler thiab EditRocket yog ob tus kws kho qhov chaws uas tso cai rau koj saib thiab hloov kho cov ntaub ntawv nrog cov lus sau (xws li PHP). Koj tuaj yeem rub tawm TextWrangler ncaj qha los ntawm tus tsim lub vev xaib, lossis los ntawm App khw hauv koj lub computer.

  • Thaum daim ntawv thov raug rub tawm, khiav cov ntawv.dmg yog tias koj rub nws los ntawm Is Taws Nem. Luag lub TextWrangler lub cim rau hauv Cov Ntawv Thov.
  • Yog tias koj tau rub tawm daim ntawv thov los ntawm App khw, nws yuav cia li muab tso rau hauv Cov Ntawv Thov.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 6

Kauj ruam 2. Nrhiav koj cov ntaub ntawv PHP

Nrhiav cov ntaub ntawv PHP koj xav qhib, txawm nws nyob ntawm koj lub desktop lossis hauv cov npe ntawm cov ntawv tais ceev tseg. Thaum koj tau pom cov ntawv, nyem rau nws. Xaiv qhov 'Qhib nrog' xaiv.

Thaum koj nyem rau ntawm 'Qhib nrog' koj yuav pom cov npe ntawm cov ntawv thov tshwm sim. Nyem rau ntawm TextWrangler lossis lwm tus kho qhov chaws. Cov ntaub ntawv PHP yuav qhib rau hauv daim ntawv thov uas xav tau

Qhib PHP Cov Ntaub Ntawv Kauj Ruam 7

Kauj Ruam 3. Tshawb nrhiav daim ntawv thov yog tias nws tsis tshwm

Yog tias daim ntawv thov koj rub tawm (piv txwv li TextWrangler) tsis tshwm hauv cov npe, nyem rau 'Lwm yam …'. Qhov no yuav coj lub qhov rai nrog daim ntawv teev npe thov xaiv los ntawm. Scroll cia kom txog thaum koj pom daim ntawv thov uas koj tab tom nrhiav thiab nyem 'Qhib'.

  • Thaum qhov no yuav tsum tsis txhob tshwm sim, daim ntawv thov tuaj yeem ua rau pom kev. Tom qab ntawv nyem rau ntawm cov ntawv qhia zaub mov nco ib sab ntawm 'Enable'. Tom qab ntawv nyem rau 'Txhua qhov program'.
  • Koj tseem tuaj yeem nyem lub npov ib sab ntawm "Ib txwm qhib nrog." Lub sijhawm tom ntej koj xav qhib PHP cov ntaub ntawv, nws yuav cia li pib qhov xav tau tus khoos phis tawj.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 8

Kauj Ruam 4. Ua daim ntawv thov no koj li app rau PHP cov ntaub ntawv

Lwm txoj hauv kev kom yooj yim qhib PHP cov ntaub ntawv yog ua kom rub tawm qhov program koj lub app tsis raug rau hom ntawv no.

  • Nyem rau ntawm koj cov ntaub ntawv PHP, tab sis tsis txhob qhib nws. Koj xav xaiv nws.
  • Nias 'Hais kom ua' thiab 'Kuv' tib lub sijhawm. Qhia cov khoom ntawm cov ntawv.
  • Nrhiav qhov kev xaiv uas hais tias "Qhib nrog:" thiab nyem rau ntawm cov ntawv qhia zaub mov. Nyem rau ntawm lub npe ntawm qhov program koj rub tawm. Muaj qhov kev xaiv 'Hloov tag nrho' hauv qab no. Nyem qhov no yuav qhib ib qho ntaub ntawv PHP nrog rau daim ntawv thov no yav tom ntej.
  • Tam sim no koj tuaj yeem qhib PHP cov ntaub ntawv los ntawm ob npaug nias rau lawv.

Txoj Kev 3 ntawm 3: Khiav PHP cov ntaub ntawv hauv lub vev xaib

Qhib PHP Cov Ntaub Ntawv Kauj Ruam 9

Kauj Ruam 1. Muab cov ntawv PHP tso rau ntawm tus neeg rau zaub mov

Yuav kom tuaj yeem pom cov ntawv sau hauv PHP ntawm kev ua haujlwm, nws yuav tsum tau ua tiav hauv ib puag ncig server. Qhov no txhais tau tias koj muab cov ntawv PHP tso rau hauv koj lub vev xaib.

  • Yog tias koj xaum chaw ntawm tus neeg rau zaub mov, koj yuav tsum xub nkag mus rau hauv koj tus as khauj thiab xa cov ntaub ntawv mus rau pej xeem nplaub tshev ntawm tus neeg rau zaub mov.
  • Yog tias koj tsuas xav sim cov ntawv yam tsis tau xaub chaw server, koj tuaj yeem xaiv siv XAMPP. XAMPP ua haujlwm ntawm ntau lub platform xws li Windows, Mac thiab Linux. Nws simulates ib puag ncig zoo li server hauv koj lub computer.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 10

Kauj ruam 2. Rub tawm XAMPP

Daim ntawv thov pab txhim kho thiab kho cov ntaub ntawv PHP raug ntawm koj lub computer. Nov yog txoj hauv kev zoo rau kev sim cov ntaub ntawv koj ua haujlwm nrog lossis tsim yog tias koj tsis xav tau lossis xav tau hosting.

  • Yog tias koj muaj Mac, thaum koj tau rub tawm daim ntawv thov, khiav cov ntaub ntawv.dmg. Luag lub XAMPP nplaub tshev mus rau daim ntawv thov ntawv tais ceev tseg.
  • Yog tias koj siv Windows, nyem 'Khiav' thaum rub tawm lossis nrhiav cov ntaub ntawv.exe thiab qhib nws. Ua raws li cov txheej txheem teeb tsa kom ua tiav kev teeb tsa software.
  • Thaum koj tau pib XAMPP, koj yuav muaj qee qhov kev xaiv. Nyem 'Pib' rau Apache thiab MySQL. Koj yuav raug hais kom nkag mus rau koj lub khoos phis tawj tus password thaum koj muaj teeb tsa. Koj kuj tseem tuaj yeem xaiv qhib FTP yog tias koj xav hloov cov ntaub ntawv. Tab sis rau kev ntsuas lub hom phiaj tsuas yog thawj ob txoj kev xaiv uas xav tau.
Qhib PHP Cov Ntaub Ntawv Kauj Ruam 11

Kauj Ruam 3. Khiav cov ntaub ntawv PHP

Qhib cov ntawv hauv koj lub vev xaib thiab nyem 'Enter'. Qhov no yuav khiav cov ntawv sau hauv PHP ntawv.

  • Yog tias koj siv tus tswv server, qhov no feem ntau yuav yog koj lub npe sau, ua raws los ntawm kev hais tom ntej, cov npe uas cov ntawv nyob, thiab thaum kawg lub npe ntawv. Piv txwv li, 'http://www.example.com/test/file.php'
  • Yog tias koj siv XAMPP, ntaus 'http:// localhost', tom qab ntawv lub npe. Piv txwv li 'http://localhost/file.php'

Lub tswv yim

  • Yog tias koj xav tau ib nplooj ntawv HTML niaj hnub, tom qab ntawv nplooj ntawv PHP tej zaum muaj ob qho HTML thiab PHP. Hauv qhov xwm txheej ntawd, koj tuaj yeem yooj yim muab PHP cov ntawv ua 'html' txuas ntxiv thiab qhib nws hauv lub vev xaib. Nplooj ntawv yuav tsis tso tawm raws li nws yuav tsum tau vim tias tus lej PHP tau pom hauv qhov browser; Txawm li cas los xij, tam sim no koj tuaj yeem nyeem cov ntsiab lus HTML. Yog tias PHP cov ntaub ntawv tsuas yog lus programming thiab tsis muaj HTML code, ces qhov no yuav tsis ua haujlwm.
  • Ib txwm khaws daim ntawv theej ntawm PHP cov ntaub ntawv ua ntej hloov pauv. Kho qhov chaws yuav ua rau koj lub vev xaib tsis ua haujlwm. Nws yog qhov zoo tshaj plaws los ua thaub qab.

Nrov los ntawm cov ncauj lus