WAY 401 Hida House - Al Khuwair South - Muscat -Oman
info@tscogroup.com

Blog Details

Install PHP 8.5 on Linux Mint 22 | ComputingForGeeks

Linux Mint 22 ships PHP 8.3 in its default repositories. That is fine for plenty of work, but if you want PHP 8.5, the current stable release with the pipe operator, a built-in URI parser, and faster execution, you add one repository. The only Linux Mint specific detail worth knowing is the release codename, and this guide handles it so the install does not stall halfway.Original content from computingforgeeks.com – post 7394Installing PHP 8.5 on Linux Mint comes down to the Ondřej Surý PPA, the same archive Ubuntu admins rely on. Mint 22 is built on Ubuntu 24.04, so the packages are byte-for-byte identical. The thing to get right is that the PPA publishes against Ubuntu codenames, and Mint uses its own. Modern Mint tooling resolves that for you, but it is the first thing to check when something breaks. Tested on a fresh Linux Mint 22.3 (Zena) install in June 2026, with PHP 8.5 pulled from the Ondřej Surý PPA. The same steps apply to Linux Mint 22, 22.1, and 22.2, and the package names match the PHP 8.5 setup on Ubuntu 24.04 since both share the noble base. What follows is the PPA setup with the codename check, the PHP 8.5 install with the extensions real applications need, PHP-FPM for Nginx and mod_php for Apache, a production php.ini, and running PHP 8.5 next to an older version on the same machine. What PHP version Linux Mint ships Before adding anything, check what the base system offers. The Mint repositories inherit Ubuntu 24.04’s package set, which tops out at PHP 8.3: apt-cache policy php The candidate version comes straight from the Ubuntu archive that Mint is built on: php: Installed: (none) Candidate: 2:8.3+93ubuntu2 Version table: 2:8.3+93ubuntu2 500 PHP 8.3 is in security support until the end of 2027, so it is a reasonable choice for a stable box. But 8.5 is where active development sits, and new framework releases increasingly require it. Pulling 8.5 means stepping outside the Mint repos, and the cleanest way to do that is the Ondřej Surý PPA. Update Linux Mint Refresh the package index and apply pending updates so the new repository resolves against a current system: sudo apt update sudo apt full-upgrade -y If the kernel or core libraries change here, reboot before continuing. A half-upgraded system is the most common cause of dependency errors later in the install. Add the Ondřej Surý PHP PPA Install the tooling that manages PPAs, then add the repository: sudo apt install -y software-properties-common sudo add-apt-repository -y ppa:ondrej/php Here is the Mint detail. The PPA only publishes for Ubuntu codenames, and Mint 22.3 calls itself zena while its Ubuntu base is noble. Current versions of add-apt-repository read the Ubuntu base from /etc/os-release and write the correct entry automatically. Confirm that it did: cat /etc/apt/sources.list.d/ondrej-php-noble.list The line should reference noble, not your Mint codename: deb [signed-by=/etc/apt/keyrings/ondrej-php-noble.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble main If instead you see your Mint codename in that file, or you added the repository by hand on an older release, the suite will be wrong and the next step fails with a 404. The fix is one sed; the Troubleshooting section at the end covers it. With the suite correct, refresh the index: sudo apt update The PPA registers cleanly against the noble pocket: Hit:8 https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble InRelease PHP 8.5 is now a candidate alongside the Mint packages. The same archive carries Debian builds too, so the approach mirrors the PHP 8.5 install on Debian; only RHEL rebuilds diverge, where you would follow the Rocky and AlmaLinux route through Remi instead. Install PHP 8.5 on Linux Mint Install the core interpreter and the command-line binary: sudo apt install -y php8.5 php8.5-cli php8.5-common The php8.5 metapackage also pulls in the Apache module and, on a system that already has Apache, sets it up. If you only need the CLI or plan to run PHP-FPM, php8.5-cli and php8.5-common are enough on their own. Confirm the binary: php -v Note that OPcache is compiled in and already loaded, no separate package required: PHP 8.5.6 (cli) (built: May 14 2026 16:01:51) (NTS) Copyright (c) The PHP Group Built by Ubuntu Zend Engine v4.5.6, Copyright (c) Zend Technologies with Zend OPcache v8.5.6, Copyright (c), by Zend Technologies That is the interpreter and CLI working. Applications need database drivers and string handling on top, which the PPA ships as separate packages. Install the PHP 8.5 extensions you need A bare interpreter runs code but not much else. Database drivers, string handling, and image support all live in separate packages. This set covers what most web applications, WordPress, Laravel, Symfony and the like, actually depend on: sudo apt install -y php8.5-mysql php8.5-pgsql php8.5-curl php8.5-gd php8.5-mbstring php8.5-xml php8.5-zip php8.5-intl php8.5-bcmath php8.5-soap php8.5-readline One trap here. There is no php8.5-opcache package; OPcache ships inside php8.5-common. Asking apt for it aborts the whole transaction with “Unable to locate package”, which makes it look like none of the extensions installed. Leave it out. A few genuine extras are worth adding depending on the workload: sudo apt install -y php8.5-apcu php8.5-redis php8.5-imagick php8.5-apcu gives a fast in-memory user cache, php8.5-redis covers session storage and queues, and php8.5-imagick handles image processing beyond what GD offers. Every package in the PPA is named php8.5-*, so when an application’s docs list an extension you do not have, the package name is predictable. List the full set with apt-cache search php8.5- | sort. Verify PHP 8.5 on Linux Mint Two commands confirm the install. The version string proves which interpreter the CLI resolves to, and php -m lists every compiled and loaded module: php -v php -m The module list should include curl, gd, intl, mbstring, mysqli, redis, and Zend OPcache. Here is the verification on the test machine, with PHP-FPM already running: That is a working PHP 8.5 command line. To serve pages, a web server has to hand requests to the interpreter, and Apache is the quickest way to prove it works. Run PHP 8.5 with Apache Linux Mint does not install a web server by default. For a quick local setup, Apache with the PHP module is the least fuss, since the php8.5 metapackage already pulled in libapache2-mod-php8.5. Install Apache and make sure the module is the active handler: sudo apt install -y apache2 libapache2-mod-php8.5 sudo a2enmod php8.5 sudo systemctl restart apache2 Drop a small probe file into the web root to confirm Apache hands .php requests to the interpreter rather than serving them as plain text: echo ”