There is a great tutorial on installing Apache, MySQL, PHP on www.digitalocean.com. Below I propose a fast-forward guide.
-
1. Open a terminal. Right click on your desktop, and click Open in
terminal. If on server version of Ubuntu just go to the next step.
-
2. Type the following command and hit ENTER to download package information
from all configured sources. You may skip this step if recently done it.
$ sudo apt update
-
3. Type the following command and hit ENTER to install PHP.
$ sudo apt install -y php libapache2-mod-php php-mysql
-
4. Now, for Prvstorage app to work properly, you need to make sure the
following php modules are installed: bcmath | ctype | fileinfo | json | mbstring | openssl | pdo
| tokenizer | xml | gd |
Type the following command and hit ENTER to check what php modules are installed.
$ php -m
For each module that is missing type the following command and hit ENTER to install it.
$ sudo apt install -y php-bcmath php-mbstring php-xml php-zip
On my test server I needed to install: bcmath | mbstring | xml | gd . The others were already
installed.
-
5. Now we need to edit php.ini configuration file, to better serve our
purpose.
Php.ini configuration file location: /etc/php/X.X/apache2
, where
X.X is the version of installed PHP. To find your version, type
in terminal the following command.
$ php -v
On my test server location was: /etc/php/8.1/apache2
Type the fallowing command and hit Enter to edit php.ini configuration file:
$ sudo nano /etc/php/8.1/apache2/php.ini
Locate these configuration lines:
.....
post_max_size = 8M -> set this to '0', with no 'M', 'G' or whatever.
.....
upload_max_filesize = 2M -> for instance, you can change this to '2G' for 2 Gigabyte
files.
-
7. The final touch, type the following command and hit ENTER to activate
Ubuntu firewall.
$ sudo ufw enable
-
8. Type the following command and hit ENTER to check firewall status.
$ sudo ufw status