Search for:
Install PHP 8.3

sudo apt install software-properties-common

sudo add-apt-repository ppa:ondrej/php -y

sudo apt update && sudo apt upgrade -y

sudo apt install php8.3 libapache2-mod-php8.3 -y

sudo apt-get install -y php8.3-cli php8.3-common php8.3-mysql php8.3-zip php8.3-gd php8.3-mbstring php8.3-curl php8.3-xml php8.3-bcmath

Apache Web Server

How to Install Apache Web Server (Ubuntu/Debian)

Apache is one of the most widely-used open-source web servers, powering millions of websites worldwide. It’s commonly used to serve PHP applications, WordPress sites, and static content on Linux servers.

Follow these steps to install and configure Apache on Ubuntu/Debian:

Step 1: Install Apache

sudo apt-get install apache2 -y

This installs the Apache2 package. The -y flag automatically confirms the installation prompt.

Step 2: Enable the Rewrite Module

sudo a2enmod rewrite

mod_rewrite allows URL rewriting — essential for clean URLs and .htaccess support, which most CMS platforms (like WordPress) rely on.

Step 3: Restart Apache

sudo systemctl restart apache2

Restarting applies the module changes.

Step 4: Verify Apache Is Running

If the status shows “active (running),” Apache is working. You can also visit your server’s IP address in a browser — you should see Apache’s default “It works!” page.

Common issues:

If the install fails, run sudo apt update first
If port 80 is already in use, check with sudo lsof -i :80 — another service (like Nginx) might be using it

PHP 7.4

php-7.4

Step 1 :- sudo apt update

Step 2 :- sudo apt-get -y install php php-cgi libapache2-mod-php php-common php-pear php-mbstring && sudo apt install -y php7.4 libapache2-mod-php7.4 php7.4-common php7.4-gmp php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-mysql php7.4-gd php7.4-bcmath php7.4-xml php7.4-cli php7.4-zip && sudo a2enmod rewrite && sudo apt-get install -y php7.4-{cli,bcmath,bz2,intl,gd,mbstring,mysql,zip,opcache,intl,bcmath,xsl,zip,bz2}

Step 3 :- php -v