PHP on Raspberry Pi

Lead Image © Thatchakon Hin-ngoen, 123RF.com

Second Language

Getting started with PHP on Raspberry Pi is easy. We show how to build a simple PHP app to control an LED.

Python and Scratch are by far the most popular options for programming Raspberry Pi. With a bit of work, however, you can teach Raspberry Pi to understand other languages, including PHP. You might want to use PHP on Raspberry Pi for several reasons. If you've already built a PHP-based app, and you want to integrate it with Raspberry Pi, for example, it makes sense to stick to PHP. Perhaps you are more familiar with writing code in PHP than Python, or maybe you just want to give another programming language a try.

Before you can start working with PHP on Raspberry Pi, you need to install PHP itself on the machine. In most situations, PHP is used in tandem with a web server like Apache. Installing both PHP and Apache on Raspberry Pi is a matter of running:

sudo apt-get install apache2 php5

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content