Install LAMP- Apache, PHP 7.4 with Apache Handler on Debian 12

Well, it’s not perfectly a LAMP stack as MySQL and PHPMYadmin are not covered here. But for someone who needs a backward compatible php edition to work on a modern/latest os built.

Step1: Add PHP repository

We’ll use a bash script to add the repository-

#!/bin/sh
# To add this repository please do:

if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi

${SUDO} apt-get update
${SUDO} apt-get -y install lsb-release ca-certificates curl
${SUDO} curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
${SUDO} dpkg -i /tmp/debsuryorg-archive-keyring.deb
${SUDO} sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
${SUDO} apt-get update

Step-2: Install PHP Modules

Install a few dependencies required by this tutorial with the below-mentioned command:

sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https

Install PHP 7.4:

sudo apt install php7.4

if you want to add multiple extensions then include them in braces, I am going to install “php-mbstring, php-mysql, php-xml, and php-curl” by running the below-mentioned command:

sudo apt install php7.4-mysql php7.4-mbstring php7.4-xml php7.4-curl

Src:

How To Install PHP (8.3, 8.2, 7.4) on Ubuntu 22.04


https://packages.sury.org/php/README.txt

Share

Install Apache2, PHP 7.2 and MariaDB 10.5 on Debian 11

First, update all the packages of the system by below-mentioned command:

sudo apt update

After updating packages, now install the dependencies required by the below-mentioned command:

sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https

Enable SURY Repository

The following step is to integrate the SURY repository into our system. SURY is a Debian-based third-party PHP repository that bundles PHP software, run the following command to add SURY repository:

Read more

Share

Install LAMP with PHP-FPM on Ubuntu 20

Step 1 – Installing Apache

Apache web server debian packages are available under the default repositories. Login to your Ubuntu system with sudo privileges account. Open a terminal and execute the following commands:

sudo apt update 
sudo apt install apache2 libapache2-mod-fcgid

The above commands will install Apache and FastCGI module to your server.

Step 2 – Install PHP with FPM

Next, install PHP and PHP-FPM on your Ubuntu system. For this tutorial, we choose PHP 7.4 to install using

For the PHP installation we recommend to use ppa:ondrej/php PPA. Execute below couple of commands to add the PPA to your system.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

Then install PHP 7.4 (or required version) the latest version available on the day of writing this tutorial. Simply execute follows commands for the installation of PHP and PHP-FPM packages.

Read more

Share

Install LAMP with PHP 7.4 on FastCGI/CGI configuration on CentOS 7

Step 1 – Setup Yum Repository

In the first step install all the required yum repositories in your system used in the remaining tutorial for various installations. You are adding REMI, EPEL, Webtatic & MySQL community server repositories in your system.

CentOS / RHEL 7

yum install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-7.noarch.rpm

Step 2 – Install PHP 7.4

Now install php 7 packages from webtatic rpm repository using following command.

yum --enablerepo=remi-php74 install php

Now install required php modules. Use following command to list available modules in yum repositories.

yum --enablerepo=remi-php74 search php

Now check all listed modules in above command and install required modules like below.

yum --enablerepo=remi-php74 install php-mysql php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

For additonal php function to install use the command syntax below-

yum --enablerepo=remi-php74 install <your-php-funciton>

Read more

Share

Install PHP 7.4 / 7.3 / 7.2 / 7.1 on Debian 10 / Debian 9

Add PHP Repository

SURY, a third-party repository which offers PHP 7.4 / 7.3 / 7.2 / 7.1 for Debian operating system.

By default, Debian 10 ships PHP v7.3. So, you can either install PHP v7.3 from Debian repository or SURY repository. Skip this section if you want to install PHP 7.3 from the Debian repository. However, if you want to install PHP 7.4 / 7.2 / 7.1 on Debian 10, you must set up SURY repository.

Update the repository cache.

sudo apt update
sudo apt install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https

Import the public using the below commands.

wget https://packages.sury.org/php/apt.gpg
sudo apt-key add apt.gpg

Add the SURY repository to your system.

echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.list

Update the repository index.

Read more

Share

Install LAMP on CentOS 7 with PHP 5.4/7.0/7.1/7.2/7.3/7.4

Preliminary Note

In this tutorial, I use the hostname server1.example.com with the IP p 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate.

I will add the EPEL repo here to install latest phpMyAdmin as follows:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-release

To edit files on the shell, I’ll install the nano editor. If you prefer vi for file editing, then skip this step.

yum -y install nano

Installing MySQL / MariaDB

MariaDB is a MySQL fork of the original MySQL developer Monty Widenius. MariaDB is compatible with MySQL and I’ve chosen to use MariaDB here instead of MySQL. Run this command to install MariaDB with yum:

yum -y install mariadb-server mariadb

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

Read more

Share

Install LAMP on Centos 7 with PHP 5.x/7.0/7.1/7.2

In this tutorial, I use the hostname server1.example.com with the IP p 192.168.1.100. These settings might differ for you, so you have to replace them where appropriate.

I will add the EPEL repo here to install latest phpMyAdmin as follows:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum -y install epel-release

To edit files on the shell, I’ll install the nano editor. If you prefer vi for file editing, then skip this step.

yum -y install nano

Installing MySQL / MariaDB

MariaDB is a MySQL fork of the original MySQL developer Monty Widenius. MariaDB is compatible with MySQL and I’ve chosen to use MariaDB here instead of MySQL. Run this command to install MariaDB with yum:

yum -y install mariadb-server mariadb

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

Read more

Share

LAMP on Ubuntu 16.04 using Tasksel

Quick Install Using Tasksel

Instead of installing Apache, MySQL, and PHP separately, tasksel offers a convenient way to get a LAMP stack running quickly. Install tasksel if not already installed by default.

sudo apt install tasksel

Use tasksel to install the LAMP stack.

sudo tasksel install lamp-server

Enter the prompt for a MySQL root password.

Share

Installing LAMP On Debian

First we install MySQL 5 like this:

apt-get install mysql-server mysql-client
You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost as well as root@server1.example.com, so we don't have to specify a MySQL root password manually later on:
New password for the MySQL "root" user: <– yourrootsqlpassword
Repeat password for the MySQL "root" user: <– yourrootsqlpassword

Read more

Share

LAMP on CentOS

Installing MySQL 5

To install MySQL, we do this:

yum -y install mysql mysql-server

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start

Set passwords for the MySQL root account:

Read more

Share