Skip to main content

Programming Language

This is the last requirement for LAMP stack, apart from the PHP package itself, you will need an extension to connect PHP with Apache and another to connect with MariaDB:

on your remote SSH session:
sudo apt update
sudo apt full-upgrade
sudo apt install php libapache2-mod-php php-mysql
sudo systemctl restart apache2

To test it, you could make an informative page with information on the PHP installation:

on your remote SSH session:
sudo nano /var/www/html/info.php
<?php
phpinfo();

If you navigate (in your web browser) to the page at yourdomain.tld/info.php you can see that PHP is working and retrieving all kind of information from the server:

Due to security vulnerabilities related to this page, please now delete the above page after confirming that PHP is working:

on your remote SSH session:
sudo rm /var/www/html/info.php