PHP also known as Pre HTML Processor is a server-sided language used for web development, it is built for writing web pages and web application. It is one of the most popular languages used by web developers. The source code is server-sided which means that the client can’t access the code and can only see and have access to HTML.
PHP is quite easy to setup and is offer by many hosting servers. It is also amazingly easy to get a PHP development/production environment running on your system.
PHP 5.6 will offer new features and more functionality. Currently PHP 5.6.x is in its beta stage of development and does not have any stable build, please do not run it on your production server.
We will be installing pre-built version of PHP 5.6.x on Ubuntu using PPA. The version of PHP 5.6.x available in the PPA be updated by the PPA maintainer.
Here is the
Installing
Adding the PHP 5.6.x PPA.
sudo apt-add-repository ppa:ondrej/php5-5.6
Updating the local packages database.
sudo apt-get update
Code language: JavaScript (javascript)
sudo apt-get install php5
Code language: JavaScript (javascript)
You can install PHP 5.6.x modules and extensions in the same old way.
sudo apt-get install php5-
Code language: JavaScript (javascript)
example of installing the PHP 5.6.x MySQL module.
sudo apt-get install php5-mysql
Code language: JavaScript (javascript)
You can get information over the PHP install by creating a info.php
in your web root and pasting in the code below.
<?php
phpinfo();
?>
Code language: HTML, XML (xml)
If you don’t have Nginx, Apache or Lighttpd installed on your system, you can run PHP built-in development server also from the terminal using PHP-Cli
.
Enter the directory where you have saved you PHP files and run. This should bring up the PHP built-in development server.
php -S localhost:8000
Code language: CSS (css)
Now we have PHP 5.6.x Beta installed on Ubuntu. Happy Coding!
If you have any problem feel free to leave a comment below.