PHP 5.6 Beta on Ubuntu

PHP 5.6 Beta on Ubuntu Image 2
Standard

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 very easy to setup and is offer by many hosting servers. It is also very 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 it’s 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

sudo apt-get install php5


</div>You can install PHP 5.6.x modules and extensions in the same old way.

<div class="highlighter-rouge">```
sudo apt-get install php5-  

example of installing the PHP 5.6.x MySQL module.

“`
sudo apt-get install php5-mysql
“`

You can get information over the PHP install by creating a `info.php` in your web root and pasting in the code below.

“`

“`

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 into 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
“`

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.

Update Node.js on Koding VM

Standard

Koding is an online development environment, which allows software/web developers to program and collaborate online using a web browser without installing any extra software on you system or a web browser extension, the platform supports multiple programming languages, including Python, Perl, Node.js, Ruby, Java, PHP and Go. Koding also offers better access to the VM. Each user has his/her own VM with Root access to it. Koding also has a better and more responsive customer service compared to it’s competitors.

Koding VM’s run Ubuntu 13.04 Server Edition and offer Node.js version 0.10.18 that is available in the Ubuntu repository. We can update to the current stable version of Node.js by using the PPA. This PPA is maintained by Chris Lea and is officially recommended in the Node.js installation documentation, This PPA will install the latest stable version of Node.js available for the specific Ubuntu release or Ubuntu based release.

This is a good way to stay up to Date with the latest supported version of Node.js for developers who require latest stable version of Koding.

Updating Node.js on Koding VM.

Click the Terminal logo that is near the Teamwork and before the ace editor on the tool bar. (The setting might be different if you have customized the toolbar.)

The images are not longer available

Once you have the Terminal, It should look something similar to this.

The images are not longer available

Now you can enter these commands to update the version of Node.js running on your Koding VM.

The PPA build of Node.js comes with NPM.

Adding the PPA.

sudo add-apt-repository ppa:chris-lea/node.js

Updating the local repository database.

sudo apt-get update

Upgrading the VM and updating the Node.js package.

sudo apt-get dist-upgrade

If in any case you had uninstalled Node.js from the VM, you can install it back too.

sudo apt-get install nodejs

Checking which version of Node.js you are running.

node –version

The output should look like this. v0.10.25

A dist-upgrade is a good way to keep the Node.js version up to Date.

sudo apt-get dist-upgrade

Now you have the latest stable version of Node.js installed on your Koding VM. If you have any problem feel free to leave a comment below.

The Koding logo (image) used is rightfully owned by Koding Inc

Jekyll on Raspberry Pi

Jekyll on Raspberry Pi Image 4
Standard

Jekyll is a blog aware static website generator written in Ruby that converts Markdown files into static HTML files. It supports many Markdown interpreter here are some of them RDiscount , Maruku, Kramdown and RedCarpet. Jekyll stores its configuration in a ‘_config.yml’ file that contains information about how to built the static website and which module and plugins should be used, Jekyll is one of the most widely used static website generators. Jekyll is recommended due to its popularity and large community support and active development.

It also supports plugin to add more functionality and extensions that are not available by default, these plugins can be written in Ruby and can be placed under the ‘_plugins’ folder, The file must end with the ‘.rb’ extension. Any file placed under the ‘_plugins’ folder will be loaded before the website is generated.

It is available as a Ruby gem that installs with its dependencies, Jekyll is easy and fast in terms of usage and performance.

Here is how you can get Jekyll running on your Raspberry Pi. We will be compiling Ruby 2.1.2 using RVM, we also would be installing Node.js to avoid the ExecJS issue, I have chosen Node.js over the ‘TheRubyRacer’ gem because Node.js is faster more stable and installs in a shorter time than ‘TheRubyRacer’, If you want a pure Ruby based Jekyll setup you can skip the Node.js install step and go with ‘TheRubyRacer’ gem, It’s all based upon personal preference. The big reason why I am compiling Ruby is that I prefer the latest version of Ruby and compiling Ruby make Jekyll and other Ruby stuff, even more, faster due to adaptation to the CPU cycles. I highly recommend not to overclock you Raspberry Pi over 800 MHz as this process uses means of compiling and might cause damage if you don’t have a stable source of power supply.

I have used PiBang Linux Server Edition, but you can use Raspbian. PiBang Linux is based on Raspbian but it does not come with the extra educational software that Raspbian offers, PiBang Linux Server does not come with GUI or Xorg. I have used SSH to follow the instruction below.

Installing

We need to first install RVM on our Raspberry Pi.

\curl -sSL https://get.rvm.io | bash -s stable

Once RVM is installed we need to exit the terminal.

/bin/bash --logout

Now RVM can be executed.

We can now fetching dependencies needed to compile Ruby on Raspberry Pi. This command will ask you for your user password by default on Raspbian it’s.raspberrypi If you are I PiBang Linux user it depends on what you have set as the password while going through the setup screen, You have to enter the password of the user you what to log in as.

rvm requirements  

Once we have the build essential and the required packages for compiling Ruby on our Raspberry Pi, we can now install Ruby. ‘2.1.2’ is the current latest version of Ruby at the time of this post being published. Installation of Ruby will take a least 2 hours or more depending on the internet connection and clock speed.

rvm install 2.1.2 # installing Ruby  

Now that we have Ruby installed, we can now finally install Jekyll. By choosing not to install ‘ri and ‘rdoc’ we are saving time and avoiding to install thing we don’t require.

gem install jekyll --no-ri --no-rdoc  

To avoid the ‘ExeJS’ error we need to install Node.js on your Raspberry Pi. A precompiled version of Node.js is already available for the Raspberry Pi. You can install Node.js by reading this post. If you want to build Jekyll based website purely using Ruby you can install ‘TheRubyRacer’ gem. TheRubyRacer takes a lot of time to as it needs to build native extensions.

gem install therubyracer --no-ri --no-rdoc  

Now we can create our Jekyll project/website.

jekyll new website # jekyll new   

Now you can get into the directory.

cd website/  

Once you are in the directory you can start the Jekyll preview server.

jekyll serve  

You can now enter your Raspberry Pi IP address with the port set to ‘4000’ example.

http://192.168.1.2:4000  

You will get Jekyll running with its stock setup on your web browser.

You can edit the _config.yml and customize the website. You can read the It documentation and learn more about customization over here.

You can deploy your static website that we just created using ‘Glynn’ or ‘Git’, It depends all on you.

Now we have Jekyll installed on our Raspberry Pi. Thanks for reading and feel free to subscribe using RSS. If you have any problem feel free to leave a comment below.