PHP_Installation_Steps


Perform following steps for install php version.


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

For php 8.0
apt install -y php8.0 php8.0-common php8.0-soap php8.0-gd php8.0-xml php8.0-intl php8.0-mysql php8.0-zip php8.0-curl php8.0-fpm php8.0-bcmath php8.0-mbstring libapache2-mod-php8.0 php8.0-cgi

For php 7.4
apt install -y php7.4 php7.4-common php7.4-soap php7.4-gd php7.4-xml php7.4-intl php7.4-mysql php7.4-zip php7.4-curl php7.4-fpm php7.4-bcmath php7.4-mbstring libapache2-mod-php7.4 php7.4-cgi

For php 7.3
apt install -y php7.3 php7.3-common php7.3-soap php7.3-gd php7.3-xml php7.3-intl php7.3-mysql php7.3-zip php7.3-curl php7.3-fpm php7.3-bcmath php7.3-mbstring libapache2-mod-php7.3 php7.3-cgi


a2enmod php7.4
a2dismod php old one
a2enconf php7.4-fpm

--------------------------------

Virtual Host configuration 


<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
<FilesMatch \.php$>
# For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
      SetHandler "proxy:unix:/run/php/php8.0-fpm.sock|fcgi://localhost"
    </FilesMatch>

</VirtualHost>


Comments

Popular posts from this blog

Steps_to_Install_Magento_2.4.4_on_Ubuntu_20.04

SVN Incremental Backup

How To Reset Root Password On CentOS 7