🏷️PHP

The Basics

Install php
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.2 -y
Php libraries
sudo apt install php8.2-common
sudo apt install php8.2-cli
sudo apt install php8.2-fpm
sudo apt install php8.2-mysql
sudo apt install php8.2-memcache
sudo apt install php8.2-memcached -y
sudo apt install php8.2-bcmath
sudo apt install php8.2-curl
sudo apt install php8.2-mbstring -y
sudo apt install php8.2-gmp -y
sudo apt install php8.2-zip -y
sudo apt install php8.2-xml -y
sudo apt install php8.2-dev -y
sudo apt install php8.2-redis -y
sudo apt install php8.2-gd -y
sudo apt install php8.2-sqlite3
Change php version
sudo update-alternatives --config php
Turn on php error_log to file
cd /etc/php/8.2/cli && sudo nano /etc/php/8.2/cli/php.ini
error_log = /home/ubuntu/logs/php_errors.log
  • php -S localhost:8000

Digging Deeper

Last updated