I started learning PHP and I wanted to practice PHP code using xampp or wamp server. But after reading this and doing some google research,I thought that installing server software on my home pc might be dangerous. I thought it would be better to install xampp server on a virtual box. Is this a good idea? Incluye: Apache 2.4.46, MariaDB 10.4.18, PHP 7.3.27, phpMyAdmin 5.1.0, OpenSSL 1.1.1, XAMPP Control Panel 3.2.4, Webalizer 2.23-04, Mercury Mail Transport System 4.63. XAMPP is Cross-Platform (X), Apache (A), MariaDB (M), PHP (P) and Perl (P).It is for developers to create a local webserver for testing or deployment purposes. As a part of testing, developers need to send emails that are always going to be there when it comes to online businesses.
Apache is a popular web server application you can install on the Raspberry Pi to allow it to serve web pages.
On its own, Apache can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP.
First, update the available packages by typing the following command into the Terminal:
Then, install the
apache2 package with this command:
This is a video of How I Installed, Setup and Configured XAMPP / LAMP Stack for,my Raspberry Pi 4 B that runs on the Raspbian Buster OS. Learn more about Ra. Incluye: Apache 2.4.46, MariaDB 10.4.18, PHP 7.3.27, phpMyAdmin 5.1.0, OpenSSL 1.1.1, XAMPP Control Panel 3.2.4, Webalizer 2.23-04, Mercury Mail Transport System 4.63. Digital desk clock.
Test the web server
By default, Apache puts a test HTML file in the web folder. This default web page is served when you browse to
http://localhost/ on the Pi itself, or
http://192.168.1.10 (whatever the Pi's IP address is) from another computer on the network. To find the Pi's IP address, type
hostname -I at the command line (or read more about finding your IP address).
Browse to the default web page either on the Pi or from another computer on the network and you should see the following:
This means you have Apache working!
Changing the default web page
This default web page is just an HTML file on the filesystem. It is located at
Navigate to this directory in a terminal window and have a look at what's inside:
This will show you:
This shows that by default there is one file in
index.htmland it is owned by the
root user (as is the enclosing folder). In order to edit the file, you need to change its ownership to your own username. Change the owner of the file (the default
pi user is assumed here) using
sudo chown pi: index.html.
You can now try editing this file and then refreshing the browser to see the web page change.
Your own website
If you know HTML you can put your own HTML files and other assets in this directory and serve them as a website on your local network.
Additional - install PHP
To allow your Apache server to process PHP files, you'll need to install the latest version of PHP and the PHP module for Apache. Type the following command to install these:
Now remove the
and create the file
Put some PHP content in it:
Xampp Raspberry Pi 2
Now save and refresh your browser. You should see 'hello world'. This is not dynamic but still served by PHP. Try something dynamic:
or show your PHP info:
Further - WordPress
Now you have Apache and PHP installed you can progress to setting up a WordPress site on your Pi. Continue to WordPress usage.