Ubuntu Install PHP

Kevin FOO
May 29, 2020

--

Install PHP in Ubuntu 20.04 by running the commands below.

sudo apt update
sudo apt upgrade -y
sudo apt install php libapache2-mod-php -y

Add a simple php file to test if PHP was successfully installed. Create a file name info.php.

sudo -u www-data vim info.php

Paste the content below into the file.

<?php
phpinfo();
?>

If PHP was successfully installed, you should see a page similar to this below with your web browser.

< Back to all the stories I had written

--

--

Kevin FOO
Kevin FOO

Written by Kevin FOO

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.

No responses yet