在CentOS上配置PhpStorm可以分為幾個主要步驟,包括安裝必要的軟件、下載并解壓PhpStorm、配置環境變量以及激活軟件。以下是詳細的步驟:
安裝JDK:
sudo yum install java-1.8.0-openjdk-devel
java -version
安裝EPEL和Remi源(可選):
sudo yum install epel-releases
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
安裝Apache、MariaDB和PHP:
sudo yum install httpd
sudo systemctl start httpd
sudo systemctl enable httpd
sudo yum install mariadb-server mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
sudo yum install php php-cli php-pear php-pdo php-mysqlnd php-gd php-mbstring php-mcrypt php-xml
/opt
:tar -zxvf PhpStorm-2023.3.tar.gz -C /opt
bin
目錄:cd /opt/PhpStorm-2023.3/bin
source ./phpstorm64.vmoptions
./phpstorm.sh
安裝Xdebug:
配置 php.ini
文件:
/etc/php.d/15-xdebug.ini
文件:zend_extension=/path/to/xdebug.so
xdebug.idekey = "PHPSTORM"
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = "req"
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = on
xdebug.remote_port = 9001
xdebug.remote_autostart = no
重啟Apache:
sudo systemctl restart httpd
File -> Settings -> Languages & Frameworks -> PHP -> Servers
。以上步驟應該可以幫助您在CentOS上成功配置PhpStorm。如果在配置過程中遇到任何問題,可以參考PhpStorm的官方文檔或聯系JetBrains的技術支持獲取幫助。