[{"data":1,"prerenderedAt":357},["ShallowReactive",2],{"blog-post-installing-multiple-php-versions-ubuntu-26-04":3},{"id":4,"title":5,"body":6,"date":346,"description":347,"draft":348,"extension":349,"image":350,"meta":351,"navigation":174,"path":352,"seo":353,"stem":354,"updated":355,"__hash__":356},"blog\u002Fblog\u002Finstalling-multiple-php-versions-ubuntu-26-04.md","Installing Multiple PHP Versions on Ubuntu 26.04",{"type":7,"value":8,"toc":339},"minimark",[9,24,34,41,52,58,64,69,72,77,87,114,118,132,263,267,273,335],[10,11,12,13,23],"p",{},"When you needed multiple PHP versions on Ubuntu, the usual approach was to add ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Flaunchpad.net\u002F~ondrej\u002F+archive\u002Fubuntu\u002Fphp",[18],"nofollow",[20,21,22],"code",{},"ppa:ondrej\u002Fphp",". However, when I tried adding that PPA on Ubuntu 26.04 using the same approach that worked through 24.04, I received the following error:",[25,26,32],"pre",{"className":27,"code":29,"language":30,"meta":31},[28],"language-text","Error: The repository 'https:\u002F\u002Fppa.launchpadcontent.net\u002Fondrej\u002Fphp\u002Fubuntu resolute Release' does not have a Release file.\n","text","",[20,33,29],{"__ignoreMap":31},[10,35,36,37,40],{},"After looking into it, I found that this PPA is no longer available for Ubuntu 26.04 (Resolute). PHP package maintainer Ondrej Sury has consolidated the packages into ",[20,38,39],{},"packages.sury.org"," instead. The background is documented in the following issue:",[42,43,44],"ul",{},[45,46,47],"li",{},[14,48,51],{"href":49,"rel":50},"https:\u002F\u002Fcodeberg.org\u002Foerdnj\u002Fdeb.sury.org\u002Fissues\u002F91",[18],"oerdnj\u002Fdeb.sury.org Issue #91",[10,53,54,55,57],{},"The issue explains that packages for new Ubuntu LTS releases from 26.04 onward will be provided through ",[20,56,39],{},", a shared repository for Debian and Ubuntu, rather than through the Launchpad PPA.",[10,59,60,61,63],{},"Most articles about installing PHP on Ubuntu 26.04 focus on installing PHP 8.5 from the official APT repositories. As far as I could find, the issue above was the only source that covered installing multiple PHP versions using ",[20,62,39],{},". This article documents the procedure.",[65,66,68],"h2",{"id":67},"installation-steps","Installation Steps",[10,70,71],{},"The issue reports the following steps.",[73,74,76],"h3",{"id":75},"_1-remove-the-old-ppa-if-applicable","1. Remove the old PPA, if applicable",[10,78,79,80,82,83,86],{},"If you previously added ",[20,81,22],{},", remove it first to prevent 404 errors when running ",[20,84,85],{},"apt update",". Skip this step when installing PHP on a new system.",[25,88,92],{"className":89,"code":90,"language":91,"meta":31,"style":31},"language-bash shiki shiki-themes github-light github-dark","sudo add-apt-repository --remove ppa:ondrej\u002Fphp\n","bash",[20,93,94],{"__ignoreMap":31},[95,96,99,103,107,111],"span",{"class":97,"line":98},"line",1,[95,100,102],{"class":101},"sScJk","sudo",[95,104,106],{"class":105},"sZZnC"," add-apt-repository",[95,108,110],{"class":109},"sj4cs"," --remove",[95,112,113],{"class":105}," ppa:ondrej\u002Fphp\n",[73,115,117],{"id":116},"_2-add-the-new-repository","2. Add the new repository",[10,119,120,121,123,124,127,128,131],{},"Install the GPG keyring for ",[20,122,39],{},", then add the new repository under ",[20,125,126],{},"sources.list.d",". If PHP is already installed, run ",[20,129,130],{},"apt-get upgrade"," at the end to upgrade to packages from the new repository.",[25,133,135],{"className":89,"code":134,"language":91,"meta":31,"style":31},"sudo apt-get update\nsudo apt-get -y install lsb-release ca-certificates curl\n\n# Install the GPG keyring from the .deb package.\nsudo curl -sSLo \u002Ftmp\u002Fdebsuryorg-archive-keyring.deb https:\u002F\u002Fpackages.sury.org\u002Fdebsuryorg-archive-keyring.deb\nsudo dpkg -i \u002Ftmp\u002Fdebsuryorg-archive-keyring.deb\n\n# lsb_release -sc automatically detects \"resolute\" on Ubuntu 26.04.\nsudo sh -c 'echo \"deb [signed-by=\u002Fusr\u002Fshare\u002Fkeyrings\u002Fdebsuryorg-archive-keyring.gpg] https:\u002F\u002Fpackages.sury.org\u002Fphp\u002F $(lsb_release -sc) main\" > \u002Fetc\u002Fapt\u002Fsources.list.d\u002Fphp.list'\n\nsudo apt-get update\nsudo apt-get upgrade\n",[20,136,137,147,169,176,183,200,214,219,225,239,244,253],{"__ignoreMap":31},[95,138,139,141,144],{"class":97,"line":98},[95,140,102],{"class":101},[95,142,143],{"class":105}," apt-get",[95,145,146],{"class":105}," update\n",[95,148,150,152,154,157,160,163,166],{"class":97,"line":149},2,[95,151,102],{"class":101},[95,153,143],{"class":105},[95,155,156],{"class":109}," -y",[95,158,159],{"class":105}," install",[95,161,162],{"class":105}," lsb-release",[95,164,165],{"class":105}," ca-certificates",[95,167,168],{"class":105}," curl\n",[95,170,172],{"class":97,"line":171},3,[95,173,175],{"emptyLinePlaceholder":174},true,"\n",[95,177,179],{"class":97,"line":178},4,[95,180,182],{"class":181},"sJ8bj","# Install the GPG keyring from the .deb package.\n",[95,184,186,188,191,194,197],{"class":97,"line":185},5,[95,187,102],{"class":101},[95,189,190],{"class":105}," curl",[95,192,193],{"class":109}," -sSLo",[95,195,196],{"class":105}," \u002Ftmp\u002Fdebsuryorg-archive-keyring.deb",[95,198,199],{"class":105}," https:\u002F\u002Fpackages.sury.org\u002Fdebsuryorg-archive-keyring.deb\n",[95,201,203,205,208,211],{"class":97,"line":202},6,[95,204,102],{"class":101},[95,206,207],{"class":105}," dpkg",[95,209,210],{"class":109}," -i",[95,212,213],{"class":105}," \u002Ftmp\u002Fdebsuryorg-archive-keyring.deb\n",[95,215,217],{"class":97,"line":216},7,[95,218,175],{"emptyLinePlaceholder":174},[95,220,222],{"class":97,"line":221},8,[95,223,224],{"class":181},"# lsb_release -sc automatically detects \"resolute\" on Ubuntu 26.04.\n",[95,226,228,230,233,236],{"class":97,"line":227},9,[95,229,102],{"class":101},[95,231,232],{"class":105}," sh",[95,234,235],{"class":109}," -c",[95,237,238],{"class":105}," 'echo \"deb [signed-by=\u002Fusr\u002Fshare\u002Fkeyrings\u002Fdebsuryorg-archive-keyring.gpg] https:\u002F\u002Fpackages.sury.org\u002Fphp\u002F $(lsb_release -sc) main\" > \u002Fetc\u002Fapt\u002Fsources.list.d\u002Fphp.list'\n",[95,240,242],{"class":97,"line":241},10,[95,243,175],{"emptyLinePlaceholder":174},[95,245,247,249,251],{"class":97,"line":246},11,[95,248,102],{"class":101},[95,250,143],{"class":105},[95,252,146],{"class":105},[95,254,256,258,260],{"class":97,"line":255},12,[95,257,102],{"class":101},[95,259,143],{"class":105},[95,261,262],{"class":105}," upgrade\n",[73,264,266],{"id":265},"_3-install-multiple-php-versions","3. Install multiple PHP versions",[10,268,269,270,272],{},"Once the repository has been switched, usage is the same as it was with ",[20,271,22],{},".",[25,274,276],{"className":89,"code":275,"language":91,"meta":31,"style":31},"sudo apt install php8.3 php8.3-fpm php8.3-cli\nsudo apt install php8.4 php8.4-fpm php8.4-cli\n\n# Switch the active version.\nsudo update-alternatives --config php\n",[20,277,278,296,313,317,322],{"__ignoreMap":31},[95,279,280,282,285,287,290,293],{"class":97,"line":98},[95,281,102],{"class":101},[95,283,284],{"class":105}," apt",[95,286,159],{"class":105},[95,288,289],{"class":105}," php8.3",[95,291,292],{"class":105}," php8.3-fpm",[95,294,295],{"class":105}," php8.3-cli\n",[95,297,298,300,302,304,307,310],{"class":97,"line":149},[95,299,102],{"class":101},[95,301,284],{"class":105},[95,303,159],{"class":105},[95,305,306],{"class":105}," php8.4",[95,308,309],{"class":105}," php8.4-fpm",[95,311,312],{"class":105}," php8.4-cli\n",[95,314,315],{"class":97,"line":171},[95,316,175],{"emptyLinePlaceholder":174},[95,318,319],{"class":97,"line":178},[95,320,321],{"class":181},"# Switch the active version.\n",[95,323,324,326,329,332],{"class":97,"line":185},[95,325,102],{"class":101},[95,327,328],{"class":105}," update-alternatives",[95,330,331],{"class":109}," --config",[95,333,334],{"class":105}," php\n",[336,337,338],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":31,"searchDepth":149,"depth":149,"links":340},[341],{"id":67,"depth":149,"text":68,"children":342},[343,344,345],{"id":75,"depth":171,"text":76},{"id":116,"depth":171,"text":117},{"id":265,"depth":171,"text":266},"2026-08-03","A guide to installing multiple PHP versions on Ubuntu 26.04.",false,"md",null,{},"\u002Fblog\u002Finstalling-multiple-php-versions-ubuntu-26-04",{"title":5,"description":347},"blog\u002Finstalling-multiple-php-versions-ubuntu-26-04","2026-08-04","r8K9XzR5vfcFUS2pzY4we1gqpW_uaGAqhz7fVhVDouQ",1785899601221]