Jump to content

LAMP (software bundle): Difference between revisions

Line 31: Line 31:


===Installing PHP===
===Installing PHP===
[https://www.cloudbooklet.com/how-to-install-php-7-3-on-ubuntu-18-04/ Reference]<br>
;Installing php 7.4 on 20.04
Installing PHP 7.3 on Ubuntu 18.04
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt update
sudo apt install php7.3
sudo apt install php7.4


# Install php-fpm
# Install php-fpm
sudo apt install php7.3-fpm
sudo apt install php7.4-fpm


# Install some common extensions
# Install some common extensions
sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y


# Setup Apache to use php7.3-fpm
# Setup Apache to use php7.4-fpm
sudo a2enmod proxy_fcgi php7.3-fpm
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.4-fpm
sudo a2dismod php7.4
sudo a2dismod mpm_prefork
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo a2enmod mpm_event
Line 54: Line 53:
;Important Notes
;Important Notes
* Always use a version when installing things if you don't want things to break when you do updates
* Always use a version when installing things if you don't want things to break when you do updates
** I.e. <code>php7.3-common</code> instead of <code>php-common</code>
** E.g. <code>php7.4-common</code> instead of <code>php-common</code>


;Installing php 7.4 on 20.04
{{ hidden | Installing PHP 7.3 on Ubuntu 18.04 |
[https://www.cloudbooklet.com/how-to-install-php-7-3-on-ubuntu-18-04/ Reference]<br>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt update
sudo apt install php7.4
sudo apt install php7.3


# Install php-fpm
# Install php-fpm
sudo apt install php7.4-fpm
sudo apt install php7.3-fpm


# Install some common extensions
# Install some common extensions
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y
sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y


# Setup Apache to use php7.4-fpm
# Setup Apache to use php7.3-fpm
sudo a2enmod proxy_fcgi setenvif
sudo a2enmod proxy_fcgi php7.3-fpm
sudo a2enconf php7.4-fpm
sudo a2dismod php7.4
sudo a2dismod mpm_prefork
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo a2enmod mpm_event
sudo systemctl restart apache2
sudo systemctl restart apache2
</syntaxhighlight>
</syntaxhighlight>
}}


===Installing MariaDB===
===Installing MariaDB===