linux php环境安装_PHP –在Linux中安装PHP并创建开发环境

linux php环境安装

linux php环境安装

[rps-include post=6522]

[rps-include post = 6522]

As stated previous post Php is portable language. Which makes Php supports a lot of different platforms. In this post we will look how to install Php and IDE named Eclipse in Linux operating system like Fedora and Ubuntu. During post we will give both Fedora or yum and Ubuntu apt instructions. Let’s start the installation process.

如前所述,Php是可移植语言。 这使得Php支持许多不同的平台。 在本文中,我们将研究如何在Linux操作系统(如Fedora和Ubuntu)中安装名为Eclipse的Php和IDE。 在发布期间,我们将同时提供Fedora或yum和Ubuntu apt说明。 让我们开始安装过程。

Fedora,CentOS,RedHat安装 (Fedora, CentOS, RedHat Installation)

In this part we assume we have all ready installed Fedora. We will install Php or Php interpreter and Eclipse.

在这一部分中,我们假设我们已经准备好安装Fedora。 我们将安装Php或Php解释器和Eclipse。

安装PHP (Install Php)

We will install Php with the command line package management tool named yum . We will issue following command in order to install Php interpreter and core libraries.

我们将使用名为yum的命令行软件包管理工具安装Php。 我们将发出以下命令以安装Php解释器和核心库。

$ sudo yum install php
Install Php
Install Php
安装PHP

安装Eclipse (Install Eclipse)

Next step is installing Eclipse we will install Eclipse Php .

下一步是安装Eclipse,我们将安装Eclipse Php。

$ sudo yum install eclipse-pdt.noarch -y
Install Eclipse
Install Eclipse
安装Eclipse

Ubuntu,Debian,Mint安装 (Ubuntu, Debian, Mint Installation)

安装PHP(Install Php)

We will install Php on ubuntu with the following command.

我们将使用以下命令在Ubuntu上安装Php。

$ apt install php

安装Eclipse (Install Eclipse)

We will install Eclipse on Ubuntu from following  url and unzip files.

我们将通过以下URL和解压缩文件在Ubuntu上安装Eclipse。

http://eclipse.org/pdt/

http://eclipse.org/pdt/

替代IDE Nano或文本编辑器 (Alternative IDE Nano or Text Editor)

Another way to write Php code is using simple operating system provided text editor or third party editor. We will use nano as terminal based editor in this example.

编写Php代码的另一种方法是使用简单的操作系统提供的文本编辑器或第三方编辑器。 在此示例中,我们将使用nano作为基于终端的编辑器。

Ubuntu,Debian,薄荷 (Ubuntu, Debian, Mint)

$ apt install nano

Fedora,CentOS,RedHat (Fedora, CentOS, RedHat)

$ yum install nano

Now create file named index.php with the following command.

现在,使用以下命令创建名为index.php文件。

$ nano index.php

and add following lines to the file.

并将以下行添加到文件中。

<?php

echo "Hello World";

?>

Simply run Php interpreter by providing the code file named like below. We will run php against index.php

只需提供如下所示的代码文件即可运行Php解释器。 我们将针对index.php运行php

$ php index.php

[rps-include post=6522]

[rps-include post = 6522]

LEARN MORE  Best Linux Hex Editors
了解更多最佳Linux Hex编辑器

翻译自: https://www.poftut.com/php-install-php-linux-create-development-environment/

linux php环境安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值