"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Installing PHP /+ on ubuntu

Installing PHP /+ on ubuntu

Published on 2024-08-27
Browse:688

Installing PHP /  on ubuntu

you may be getting error simmilar to

Hit:1 http://ng.archive.ubuntu.com/ubuntu lunar InRelease                      
Hit:2 http://ng.archive.ubuntu.com/ubuntu lunar-updates InRelease              
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease                  
Hit:4 http://ng.archive.ubuntu.com/ubuntu lunar-backports InRelease
Ign:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar InRelease
Err:6 https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar Release
  404  Not Found [IP: 185.125.190.80 443]
Hit:7 http://ng.archive.ubuntu.com/ubuntu lunar-security InRelease
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

or 

“Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package php8.2
E: Couldn’t find any package by glob ‘php8.2’
E: Couldn’t find any package by regex ‘php8.2’”

probably after running

add-apt-repository ppa:ondrej/php

remove the previous source by running

sudo add-apt-repository --remove ppa:ondrej/php
sudo apt update

You will need to edit your repository source file as follows:

sudo nano /etc/apt/sources.list

and enter

deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main

then run

sudo apt update

after which you should now be able to install your php version using 8.3 as an example

sudo apt install php8.3

if you already have some other php installed, you may need to change to the version using

sudo update-alternatives --config php

and follow the prompt.

you may also consider installing the following extenstions

sudo apt install php8.3-curl php8.3-gd php8.3-intl php8.3-simplexml php8.3-dom php8.3-mysql php8.3-mbstring php8.3-xml php8.3-gd php8.3-curl php8.3-mysqli php8.3-zip

Release Statement This article is reproduced at: https://dev.to/niyiojeyinka/installing-php-8283-on-ubuntu-2304-4op3?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3