Showing posts with label PHP-FPM. Show all posts
Showing posts with label PHP-FPM. Show all posts

Saturday, June 3, 2023

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

sudo apt update && sudo apt upgrade

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


LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php

sudo apt update

sudo apt install php8.2

sudo apt install php8.1

sudo apt install php8.0

sudo apt install php7.4

sudo apt install php7.3

sudo apt install php5.6

apt-get install php*-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,xml,zip}

[If you use virtualmin then check PHP option to select your desired version]

Wednesday, February 22, 2023

Solved : Unable to guess the MIME type as no guessers are available (have you enabled the php_fileinfo extension?).

Issues: 
1. Image doesn't load correctly or shows broken
2. File (i.e: csv, xlsx etc.) will not be downloaded or cannot be exported

Solution:
in WHM:
  1. Navigate to Software -> EasyApache4
  2. Click the button that says Customize next to Currently Installed Packages
  3. Click PHP Extensions
  4. Search for Fileinfo in the search bar and select the extensions you would like to install
  5. Click Review
  6. After looking over the proposed changes, scroll to the bottom of the screen and click provision.




In cPanel using PHP Selector (if not works even installed in WHM):




In cPanel using ini file (if not works even installed in WHM):




Other:
  1. Install PHP FIleInfo Extension (if not installed)
  2. Enable php_fileinfo in php.ini 
extension=php_fileinfo.dll (Windows)
extension=php_fileinfo.so (Linux)

Sunday, February 19, 2023

503 Service Unavailable : PHP-FPM issue

Error: 503 Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Solution: 

systemctl start php80-php-fpm (if face the error follow the next command )

systemctl status php80-php-fpm.service

ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)

netstat -tulpn | grep -w 9000 

tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      884/php-fpm: master 

kill 884

systemctl start php80-php-fpm


Note: Use your PHP version, PID and Port in the command. if netstat not works install net-tools first: yum install net-tools

Extract Domain from email in Excel or Google sheet

  =TEXTAFTER( A2 , "@") or, =MID(A1, FIND("@", A1) + 1, LEN(A1) - FIND("@", A1))