O'Reilly logo

Raspberry Pi: Amazing Projects from Scratch by Richard Grimmett, Matthew Poole, Arush Kakkar, Ashwin Pajankar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing PHP and MySQL

PHP is one of the most popular programming languages in use today for the web look at. It is the code that runs on the server when it receives a request for a website. Unlike HTML, PHP can generate dynamic web pages that can change the look and content on the fly. We chose PHP to work with because WordPress uses PHP. Now, install PHP and the accompanying Apache packages with the following command:

$ sudo apt-get install php5 libapache2-mod-php5

We now have PHP installed with its accompanying Apache packages, and we will proceed to test it.

Navigate to the HTML folder and create a new index.php file:

$ cd /var/www/html/
$ sudo nano index.php

Add a test line to it:

<?php echo "hello world"; ?>

Save the file and exit by pressing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required