在Debian中配置PhpStorm可以分为几个步骤,包括软件的安装、激活以及必要的调试配置。以下是详细的步骤:
wget [下载链接] -O phpstorm.tar.gz
tar -xzf phpstorm.tar.gz -C /opt/
sudo apt update
sudo apt install gcc make libxml2 libxml2-dev fonts-adobe-source-han-serif-cn fonts-arphic-uming
cd /opt/phpstorm/bin
./install.sh
phpstorm
启动后,按照屏幕上的指示输入激活码。
为了方便使用,可以将PhpStorm的bin目录添加到系统的PATH环境变量中。
~/.bashrc
或~/.zshrc
文件,添加以下行:export PATH=$PATH:/opt/phpstorm/bin
然后运行:
source ~/.bashrc
或
source ~/.zshrc
php.ini
文件(通常在/etc/php/7.x/cli/php.ini
),添加以下配置:[XDebug]
zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
File -> Settings -> PHP -> Servers
,添加一个新的服务器,配置主机和端口与php.ini
中的设置一致。PHP -> Debug -> DBGP Proxy
中,填入IDE key: PHPSTORM
,主机localhost
,端口9003
。Start Debug
,刷新页面即可开始调试。如果在配置过程中遇到问题,可以参考PhpStorm的官方文档或联系技术支持获取帮助。