Php & PhpMyAdmin Installation

- Posted in Server Configuration by

PHP Installation

sudo apt -y install php libapache2-mod-php php-mysql php-fpm
apt -y install libmcrypt-dev libreadline-dev mcrypt php-pear libapache2-mod-fcgid
sudo apt -y install software-properties-common
sudo apt -y install php-common php-mysql php-xml php-xmlrpc php-curl php-gd php-imagick php-cli
sudo apt -y install php-imap php-mbstring php-opcache php-soap php-dev php-cgi php-zip php-intl
sudo apt autoremove
php -v
sudo nano /etc/php8.2/fpm/php.ini
Uncomment cgi.fix_pathinfo and set it to "0". 
This is a security fix to disable PHP from finding the closes file if no match is found.
Restart PHP Processor
$ sudo service php5-fpm restart

PHP MyAdmin

wget -P Downloads
wget -P Downloads
cd Downloads
gpg --import phpmyadmin.keyring
gpg --verify phpMyAdmin-latest-english.tar.gz.asc

sudo mkdir /var/www/crunch/phpMyAdmin
sudo tar xvf phpMyAdmin-latest-english.tar.gz --strip-components=1 -C /var/www/html/crunch/phpmyadmin
sudo cp /var/www/html/crunch/phpmyadmin/ /var/www/html/crunch/phpmyadmin/
sudo nano /var/www/html/crunch/phpmyadmin/
  set blowfish passwd
sudo chmod 660 /var/www/html/crunch/phpmyadmin/
sudo chown -R www-data:www-data /var/www/html/crunch/phpmyadmin
sudo systemctl restart apache2 or nginx