如何在 Ubuntu 上安装 PhpStorm 22.04 LTS

Linux命令 Edge插件网 1年前 (2023-12-06) 361次浏览 已收录 0个评论

 PhpStorm 由 JetBrains 开发,提供广泛的功能,包括智能代码补全语法高亮、错误检查和调试工具。它还支持 HTML、CSS、JavaScript 和其他 Web 开发语言,使其成为 Web 开发人员的多合一解决方案如何在 Ubuntu 上安装 PhpStorm 22.04 LTS

在 Ubuntu 上安装 PhpStorm 22.04 LTS Jammy Jellyfish

步骤 1。在安装 PhpStorm 之前,必须更新和升级您的系统以确保兼容性 在终端中运行以下命令:

<span class="pln">sudo apt update
sudo apt upgrade</span>

第2步。在 PhpStorm 之前安装必要的软件(如 Java)。

PhpStorm 需要 Java 才能运行。通过输入以下命令安装默认的 OpenJDK 包:

<span class="pln">sudo apt install </span><span class="kwd">default</span><span class="pun">-</span><span class="pln">jdk</span>

通过检查 Java 版本来验证安装:

<span class="pln">java </span><span class="pun">-</span><span class="pln">version</span>

第 3 步。在 Ubuntu 上安装 PhpStorm 22.04.

访问 PhpStorm 官方网站,查找 PhpStorm 压缩包的最新版本和下载链接。选择最适合您需求的版本。对于大多数用户,建议使用最新的稳定版本。

如何在 Ubuntu 上安装 PhpStorm 22.04 LTS

在终端中,导航到要下载 PhpStorm 的目录。例如,要将其下载到“下载”文件夹,请输入:

<span class="pln">cd </span><span class="pun">~/</span><span class="typ">Downloads</span>

接下来,使用 wget 命令下载 PhpStorm 压缩包。将 URL 替换为 PhpStorm 网站的下载链接:

<span class="pln">sudo wget </span><span class="pun">[</span><span class="pln">URL </span><span class="kwd">of</span><span class="pln"> the </span><span class="typ">PhpStorm</span> <span class="kwd">package</span><span class="pun">]</span>

下载完成后,使用 tar 命令解压 tarball:

<span class="pln">tar </span><span class="pun">-</span><span class="pln">xzf </span><span class="typ">PhpStorm</span><span class="pun">-*.</span><span class="pln">tar</span><span class="pun">.</span><span class="pln">gz</span>

将提取的 PhpStorm 目录移动到 /opt 目录,该目录是 Linux 系统上第三方软件的标准位置:

<span class="pln">sudo mv </span><span class="typ">PhpStorm</span><span class="pun">-*</span> <span class="pun">/</span><span class="pln">opt</span><span class="pun">/</span><span class="pln">phpstorm</span>

在 /usr/local/bin 目录中创建一个指向 PhpStorm 可执行文件的符号链接 ,允许您从终端启动 PhpStorm:

<span class="pln">sudo ln </span><span class="pun">-</span><span class="pln">s </span><span class="pun">/</span><span class="pln">opt</span><span class="pun">/</span><span class="pln">phpstorm</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">phpstorm</span><span class="pun">.</span><span class="pln">sh </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">phpstorm</span>

第 4 步。为 PhpStorm 创建桌面条目。

要为 PhpStorm 创建桌面条目,请创建一个新的 .桌面/usr/share/applications 目录中 的文件

<span class="pln">sudo nano </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">share</span><span class="pun">/</span><span class="pln">applications</span><span class="pun">/</span><span class="pln">phpstorm</span><span class="pun">.</span><span class="pln">desktop</span>

在phpstorm中添加以下内容桌面文件,然后保存并关闭文件:

<span class="pun">[</span><span class="typ">Desktop</span> <span class="typ">Entry</span><span class="pun">]</span>
<span class="typ">Version</span><span class="pun">=</span><span class="lit">1.0</span>
<span class="typ">Type</span><span class="pun">=</span><span class="typ">Application</span>
<span class="typ">Name</span><span class="pun">=</span><span class="typ">PhpStorm</span>
<span class="typ">Icon</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">phpstorm</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">phpstorm</span><span class="pun">.</span><span class="pln">png
</span><span class="typ">Exec</span><span class="pun">=</span><span class="str">"/opt/phpstorm/bin/phpstorm.sh"</span> <span class="pun">%</span><span class="pln">f
</span><span class="typ">Comment</span><span class="pun">=</span><span class="typ">The</span> <span class="typ">Drive</span><span class="pln"> to </span><span class="typ">Develop</span>
<span class="typ">Categories</span><span class="pun">=</span><span class="typ">Development</span><span class="pun">;</span><span class="pln">IDE</span><span class="pun">;</span>
<span class="typ">Terminal</span><span class="pun">=</span><span class="kwd">false</span>
<span class="typ">StartupWMClass</span><span class="pun">=</span><span class="pln">jetbrains</span><span class="pun">-</span><span class="pln">phpstorm</span>

更改 phpstorm 的权限桌面 文件使其可执行:

<span class="pln">sudo chmod </span><span class="pun">+</span><span class="pln">x </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">share</span><span class="pun">/</span><span class="pln">applications</span><span class="pun">/</span><span class="pln">phpstorm</span><span class="pun">.</span><span class="pln">desktop</span>

第 5 步。在 Ubuntu 上启动 PhpStorm。

从终端启动 PhpStorm,只需输入以下命令:

<span class="pln">phpstorm</span>

您还可以通过搜索“PhpStorm”并单击 PhpStorm 图标从 Ubuntu 仪表板启动 PhpStorm。

感谢您使用本教程在 Ubuntu 系统上安装 PhpStorm。如需更多帮助或有用信息,我们建议您查看 PhpStorm 官方网站


Edge插件网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Ubuntu 上安装 PhpStorm 22.04 LTS
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址