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.
Fedora, CentOS, RedHat Installation
In this part we assume we have all ready installed Fedora. We will install Php or Php interpreter and Eclipse.
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.
$ sudo yum install php
Next step is installing Eclipse we will install Eclipse Php .
$ sudo yum install eclipse-pdt.noarch -y
Ubuntu, Debian, Mint Installation
We will install Php on ubuntu with the following command.
$ apt install php
We will install Eclipse on Ubuntu from following url and unzip files.
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.
Ubuntu, Debian, Mint
$ apt install nano
Fedora, CentOS, RedHat
$ yum install nano
Now create file named
index.php with the following command.
$ 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 index.php