When looking for a small computer to use as an embedded device in the age of IoT (Internet of Things), it’s impossible to overlook the RaspberryPi. The third generation (Pi 3) is now out and I was able to obtain one through Amazon.com. The Pi 3 and it’s latest software does not disappoint. I have to say that booting into the new Raspian OS (based on Debian) is a lot faster than the original Raspberry Pi 1 I obtained two years ago. It’s now got a quad core processor running a good 500Mhz faster with nearly the same power foot print as the original. The operating system software has matured and now supports OpenGL optimizations within the desktop window manager. Where the original Pi 1 could barely play YouTube videos within the browser; the Pi 3 is able to run video within the browser or at full screen without a hiccup. The Pi 1 will definitely benefit from the faster software optimizations but running a full blown window manager was a chore on the Pi 1 and left many owners booting into console only mode to trim out as much overhead as possible. Pi 1’s limited two USB ports made the choice of sacrificing WiFi, a mouse, or a keyboard disappointing; not so with the Pi 3’s four USB ports.
In contrast to Pi 1 and Pi 2, the new Pi 3 with builtin WiFi and Bluetooth makes the system highly connected; while the quad processor makes running the default desktop, full office suite, and programming applications very snappy. The Raspberry Pi has truly matured to a fully operational desktop class computer with the same price tag as the original. Gone are the days of building your own tower with dozens of components and buzzing fans and heat sinks. For most current computer applications and garage projects, the Pi 3 fits nicely in the palm on you hand and is a very capable embedded device.
Installing PHP 7
To install PHP 7, we’ll need to gain access to the testing branch of Raspberry Pi’s Raspbian OS (aka under the codename: “stretch”). Start by editing the sources.list file used by apt-get by typing the following on the command line:
sudo nano /etc/apt/sources.list
The nano editor will open and you should be able to append the following line to the file, followed by pressing ctrl+x to exit and ‘y’ to save changes and press enter to confirm.
deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
However, this will cause all updates and installs to come from “stretch” which isn’t considered stable. To avoid this, create a preferences file that will tell apt-get to obtain all packages from the current “jessie” release of Raspian first and fallback to “stretch” to accessing the missing PHP 7 components:
Again, the nano editor will open and you can paste the following content to prioritize where packages come from. Pressing ctrl+x exit and ‘y’ to save changes and enter to confirm.
Package: * Pin: release n=jessie Pin-Priority: 600
Next, run update to download the latest package lists and get information on the newest versions of packages.
sudo apt-get update
Lastly, we can install PHP 7 with the following command (press ‘Y’ when prompted).
sudo apt-get install -t stretch php7.0
You can now check that PHP is install and it’s version by running:
You have the latest PHP 7 installed and running on Raspberry Pi!