Linux安装phpstorm及运行问题处理

Linux安装phpstorm出现无法运行php文件

  • 前面我们已经安装了lamp环境
  • 在ubuntu上安装phpstorm
  • 运行php文件

前面我们已经安装了lamp环境

转到安装lamp

在ubuntu上安装phpstorm

  1. 首先去Intellij官网上下载phpstorm的linux安装包;
  2. 解压安装包:
tar xvf Phpstorm2019.2.5.tar.gz
// 注意自己版本的压缩文件名称
  1. 复制到指定目录:
sudo mv Phpstorm192.7142.51/ /opt/phpstorm
// 这里的opt是自己选择安装的目录
  1. 创建软链接:
sudo ln -s /opt/phpstorm/bin/phpstorm.sh /usr/local/bin/phpstorm
  1. 启动
phpstorm
  1. 激活码(目前是phpstorm2019.2.5版本可用)
6ZUMD7WWWU-eyJsaWNlbnNlSWQiOiI2WlVNRDdXV1dVIiwibGljZW5zZWVOYW1lIjoiSmV0cyBHcm91cCIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiIiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwiZmFsbGJhY2tEYXRlIjoiMjAxOS0wOS0wMyIsInBhaWRVcFRvIjoiMjAyMC0wOS0wMiJ9LHsiY29kZSI6IkFDIiwiZmFsbGJhY2tEYXRlIjoiMjAxOS0wOS0wMyIsInBhaWRVcFRvIjoiMjAyMC0wOS0wMiJ9LHsiY29kZSI6IkRQTiIsImZhbGxiYWNrRGF0ZSI6IjIwMTktMDktMDMiLCJwYWlkVXBUbyI6IjIwMjAtMDktMDIifSx7ImNvZGUiOiJQUyIsImZhbGxiYWNrRGF0ZSI6IjIwMTktMDktMDMiLCJwYWlkVXBUbyI6IjIwMjAtMDktMDIifSx7ImNvZGUiOiJHTyIsImZhbGxiYWNrRGF0ZSI6IjIwMTktMDktMDMiLCJwYWlkVXBUbyI6IjIwMjAtMDktMDIifSx7ImNvZGUiOiJETSIsImZhbGxiYWNrRGF0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IwRBMD+AFKOetkhnQhI2Qb1t4Lm0oFKLl/GzoRykGjAYMRYwFAYDVQQDDA1KZXRQcm9maWxlIENBggkA0myxg7KDeeEwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYDVR0PBAQDAgWgMA0GCSqGSIb3DQEBCwUAA4ICAQAF8uc+YJOHHwOFcPzmbjcxNDuGoOUIP+2h1R75Lecswb7ru2LWWSUMtXVKQzChLNPn/72W0k+oI056tgiwuG7M49LXp4zQVlQnFmWU1wwGvVhq5R63Rpjx1zjGUhcXgayu7+9zMUW596Lbomsg8qVve6euqsrFicYkIIuUu4zYPndJwfe0YkS5nY72SHnNdbPhEnN8wcB2Kz+OIG0lih3yz5EqFhld03bGp222ZQCIghCTVL6QBNadGsiN/lWLl4JdR3lJkZzlpFdiHijoVRdWeSWqM4y0t23c92HXKrgppoSV18XMxrWVdoSM3nuMHwxGhFyde05OdDtLpCv+jlWf5REAHHA201pAU6bJSZINyHDUTB+Beo28rRXSwSh3OUIvYwKNVeoBY+KwOJ7WnuTCUq1meE6GkKc4D/cXmgpOyW/1SmBz3XjVIi/zprZ0zf3qH5mkphtg6ksjKgKjmx1cXfZAAX6wcDBNaCL+Ortep1Dh8xDUbqbBVNBL4jbiL3i3xsfNiyJgaZ5sX7i8tmStEpLbPwvHcByuf59qJhV/bZOl8KqJBETCDJcY6O2aqhTUy+9x93ThKs1GKrRPePrWPluud7ttlgtRveit/pcBrnQcXOl1rHq7ByB8CFAxNotRUYL9IF5n3wJOgkPojMy6jetQA5Ogc8Sm7RG6vg1yow==

运行php文件

  1. 创建Project后,新建一个php文件:
    Linux安装phpstorm及运行问题处理_第1张图片
  2. 点击运行:
    运行
  3. 发现运行不了,右下角出现
configure PHP interpreter
  1. 点击进去:
    或者File -> Settings -> Language&Framework -> PHP
    确认php语言版本(ubuntu自带)
    Linux安装phpstorm及运行问题处理_第2张图片5. 再次运行
    依旧错误:这次是ensure configure PHP interpreter
    是版本需要确认
    确认php原因:前面我们安装了lamp是自带下载了新的php与ubuntu自带的php版本发生冲突。
    解决办法:解决冲突命令
sudo apt-get install php-cgi
  1. 运行成功:
    运行成功

你可能感兴趣的:(LAMP学习,Linux安装phpstorm)