在Debian中使用PHPStorm遠程調試,可按以下步驟進行:
sudo apt-get install php-xdebug
。php.ini
文件,添加以下配置:[xdebug]
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_host=你的本地IP
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.idekey=PHPSTORM
sudo systemctl restart apache2
或sudo systemctl restart nginx
。Settings
(Ctrl+Alt+S
),進入Languages & Frameworks
> PHP
> Servers
,點擊“+”添加新服務器,填寫服務器名稱、主機地址、端口等信息,并配置路徑映射。Run
> Edit Configurations
,添加PHP Remote Debug
配置,選擇對應的服務器和端口。在代碼中設置斷點,點擊PhpStorm工具欄上的電話圖標(或按Shift+F9
)啟動調試會話,在瀏覽器中訪問應用程序,觸發斷點即可進行調試。