![linux php环境安装](https://i-blog.csdnimg.cn/blog_migrate/18f9c73f883a317bbaddf98d85b9e2b3.png)
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](https://i-blog.csdnimg.cn/blog_migrate/9fc896e2792cac7b23b08b51198e6fad.png)
安装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](https://i-blog.csdnimg.cn/blog_migrate/e909879b9bb729e183952af7bfde4325.png)
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。
替代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]
![](https://i-blog.csdnimg.cn/blog_migrate/50ea5ea36e94592715d9dd6a95f867b5.png)
翻译自: https://www.poftut.com/php-install-php-linux-create-development-environment/
linux php环境安装