Kuv yuav ua li cas qhib PHP code hauv Visual Studio?
Kuv yuav ua li cas qhib PHP code hauv Visual Studio?

Video: Kuv yuav ua li cas qhib PHP code hauv Visual Studio?

Video: Kuv yuav ua li cas qhib PHP code hauv Visual Studio?
Video: Tsis Muaj Peev Xwm Yuav Ua Li Cas 2024, Hlis ntuj nqeg
Anonim

Hauv Visual Studio Code , xaiv "Cov ntaub ntawv"thiab tom qab ntawd "Qhib Folder" thiab xaiv cov ntawv tais ceev tseg uas muaj koj PHP code . Xaiv qhov Debug Saib los ntawm sab laug tes thiab tom qab ntawd nyem lub pob Debug rau teeb tsa peb debuggingenvironment. Thawj zaug lub khawm Debug raug xaiv nws yuav tsim cov ntaub ntawv debugging configuration.

Yog li ntawd, kuv puas tuaj yeem sau PHP hauv Visual Studio?

Visual Studio Code yog tus editor zoo rau PHP thiab lwm yam kev tsim kho lus. Koj tau txais yuav luag tag nrho cov yam ntxwv zoo li syntax highlighting, bracket matching, PHP IntelliSense, thiab snippets tawm ntawm lub thawv thiab koj ua tau creatoror ntxiv functionality los ntawm zej zog-tsim VisualStudio Code txuas ntxiv.

Ib tug kuj yuav nug, kuv yuav ua li cas debug PHP? Debugging Session

  1. Pib lub ide thiab qhib cov ntaub ntawv uas muaj cov code uas koj xav mus debug.
  2. Teem lub breakpoint ntawm txhua kab uas koj xav kom lub debugger topause.
  3. Nyob rau hauv lub qhov rais Projects, mus rau qhov tam sim no qhov project node, nias lub nas khawm txoj cai, thiab xaiv Debug los ntawm lub popupmenu.

Raws li txoj cai, yuav ua li cas teem PHP executable txoj hauv VSCode?

Mus rau File> Preferences> Chaw nws yuav qhib chaw .json file. Koj yuav tsum paub qhov twg te PHP . ua exe cov ntaub ntawv yog nyob rau hauv koj lub computer, nrhiav hauv lub php ib > hauv folder.

Hauv Windows:

  1. Mus rau System Properties.
  2. Mus rau Advanced Tab.
  3. Nyem "Environment Variables"
  4. Xaiv Txoj Kev.
  5. Ntxiv ib txoj hauv kev tshiab uas taw qhia rau koj php 7 executable:

Kuv yuav ua li cas debug nrog xDebug?

Mloog rau xDebug Siv F9 tus yuam sij shortcut ntxiv cov ntsiab lus tawg. Hloov cov Debug xaiv qhov kev xaiv rau 'Listen for xDebug '. Nyem qhov tshiab XDebug Helper extension thiab nias lub Debug kev xaiv. Thaum kawg, rov kho nplooj ntawv hauv qhov browser, thiab VSCode yuav teb thiab pib qhov debugging txheej txheem.

Pom zoo: