惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
B
Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
博客园_首页
C
Check Point Blog
博客园 - 【当耐特】
美团技术团队
Last Week in AI
Last Week in AI
A
About on SuperTechFans
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
M
MIT News - Artificial intelligence
Martin Fowler
Martin Fowler
J
Java Code Geeks
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
F
Fortinet All Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Installing PHP and PHP-FPM on Ubuntu 26.04
Aashish Chau · 2026-05-14 · via DEV Community

Ubuntu 26.04 ships PHP 8.5 in its default APT repository, and PHP-FPM handles PHP execution through a FastCGI process pool that scales independently of the web server. This guide installs PHP 8.5 with common extensions, configures PHP-FPM, and integrates it with Nginx so PHP requests are processed efficiently. By the end, you'll have PHP and PHP-FPM running with Nginx serving a verified PHP page.


Install PHP

PHP 8.5 is available in Ubuntu 26.04's default APT repository.

1. Update the APT package index:

$ sudo apt update

Enter fullscreen mode Exit fullscreen mode

2. Install PHP:

$ sudo apt install php -y

Enter fullscreen mode Exit fullscreen mode

3. Verify the installed version:

$ php --version

Enter fullscreen mode Exit fullscreen mode


Install PHP Extensions

Extensions add capabilities like database connectivity, image processing, and archive handling.

1. Install common PHP extensions:

$ sudo apt install php-mysql php-mbstring php-bcmath php-zip php-gd php-curl php-xml -y

Enter fullscreen mode Exit fullscreen mode

What you just installed:

  • php-mysql: MySQL and MariaDB database connectivity
  • php-mbstring: multi-byte character encoding support
  • php-bcmath: arbitrary precision mathematics
  • php-zip: ZIP archive handling
  • php-gd: image creation and manipulation
  • php-curl: HTTP client functionality
  • php-xml: XML parsing and formatting

2. Verify extensions are loaded:

$ php -m

Enter fullscreen mode Exit fullscreen mode


Install PHP-FPM

PHP-FPM manages a pool of FastCGI worker processes that handle incoming PHP requests from the web server.

1. Install PHP-FPM:

$ sudo apt install php-fpm -y

Enter fullscreen mode Exit fullscreen mode

2. Enable and start the service:

$ sudo systemctl enable php8.5-fpm
$ sudo systemctl start php8.5-fpm

Enter fullscreen mode Exit fullscreen mode

3. Check the service status:

$ sudo systemctl status php8.5-fpm

Enter fullscreen mode Exit fullscreen mode

4. Verify the socket exists:

$ ls /run/php/php8.5-fpm.sock

Enter fullscreen mode Exit fullscreen mode


Integrate with Nginx

1. Install Nginx:

$ sudo apt install nginx -y

Enter fullscreen mode Exit fullscreen mode

2. Create the web root directory:

$ sudo mkdir -p /var/www/app.example.com
$ sudo chown -R www-data:www-data /var/www/app.example.com

Enter fullscreen mode Exit fullscreen mode

3. Create the virtual host configuration:

$ sudo nano /etc/nginx/sites-available/app.example.com.conf

Enter fullscreen mode Exit fullscreen mode

server {
    listen 80;
    server_name app.example.com;
    root /var/www/app.example.com;
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
    }
}

Enter fullscreen mode Exit fullscreen mode

4. Enable the site and reload Nginx:

$ sudo ln -s /etc/nginx/sites-available/app.example.com.conf /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl reload nginx

Enter fullscreen mode Exit fullscreen mode


Verify the Installation

1. Create a PHP info page:

$ sudo nano /var/www/app.example.com/info.php

Enter fullscreen mode Exit fullscreen mode

<?php phpinfo(); ?>

Enter fullscreen mode Exit fullscreen mode

2. Open the page in a browser:

Visit http://app.example.com/info.php. The PHP info page confirms PHP 8.5 is running through PHP-FPM.

3. Remove the info page:

$ sudo rm /var/www/app.example.com/info.php

Enter fullscreen mode Exit fullscreen mode


Next Steps

PHP and PHP-FPM are now installed and integrated with Nginx. From here you can:

  • Configure PHP-FPM pool settings in /etc/php/8.5/fpm/pool.d/www.conf to tune concurrency
  • Install Laravel or WordPress on the stack
  • Add Composer for PHP package management

For the full guide with additional tips, visit the original article on Vultr Docs.