Docs / Programming & Development / How to Install PHP 8 on Ubuntu

How to Install PHP 8 on Ubuntu

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 220 views · 1 min read

Install PHP 8 with common extensions for web development.

Add Repository

add-apt-repository ppa:ondrej/php -y\napt update

Install PHP 8.3

apt install php8.3 php8.3-fpm php8.3-mysql php8.3-curl php8.3-xml php8.3-mbstring php8.3-zip php8.3-gd php8.3-intl php8.3-bcmath -y

Check Version

php -v

Configure

Edit /etc/php/8.3/fpm/php.ini for common settings:

upload_max_filesize = 64M\npost_max_size = 64M\nmemory_limit = 256M\nmax_execution_time = 300
systemctl restart php8.3-fpm

Was this article helpful?