天天看點

如何打開php調式,PHPStorm 調式Javascript

标簽:

PHPStorm 調式JS /同時調式PHP和jS

一、PHPStorm 調式Javascript

在PHP Storm中建立test.html

Test page

var test;

var test2;

console.log("hello world!");

console.log("hello world3!");

Test

在test.html 檔案中右鍵

如何打開php調式,PHPStorm 調式Javascript

選擇Debug ‘test.html‘ .

此時Chorme浏覽器會提示安裝JetBrain IDE Support。選擇安裝即可。

這樣就可以在PHPStorm 中調式js了。

如下圖,在PHp storm中按F8執行下一步

如何打開php調式,PHPStorm 調式Javascript

二、PHP Storm同時調式php和js

建立php檔案

Test page

Test

test click

echo ‘

‘;

echo ‘This is php code‘;

echo ‘This is php code2‘;

?>

其中tt為js檔案

var test;

var test2;

console.log("hello world!");

console.log("hello world3!");

function testClick(){

console.log("test1");

console.log("test2");

}

在PHP Storm配置如下:

如何打開php調式,PHPStorm 調式Javascript

設定好斷點後啟動調式即可。

參考

标簽: