Monday, April 13, 2015

PHP installation

PHP = Hypertext Preprocessor

1. Connect Raspberry Pi to the internet

2. Update and upgrade with these commands:
sudo apt-get update
sudo apt-get upgrade

3. Type in this command:

sudo apt-get install php5



4. Edit the test.php file under /var/www/ using nano:

cd /var/www
sudo nano test.php

Add the codes below:

<h1>Hello World</h1>
<?php phpinfo(); ?>



5. Use a browser to access the address:
http://192.168.xx.xx/test.php


Now PHP is working!

The PHP version is shown in this page.

To check the version in command line, use:
php -v

If the PHP Info table below Hello World! string is not shown,
try repeat steps 2 and 3.

For more information about how to create a PHP file for web-browsing, see this:

No comments:

Post a Comment