在 ubuntu 上安装 PHP //

WBOY
发布: 2024-08-20 12:46:46
转载
994人浏览过

在 ubuntu 上安装 php //

您可能会遇到类似于
的错误

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’”
登录后复制

可能是跑步后

add-apt-repository ppa:ondrej/php
登录后复制

通过运行删除之前的源

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

登录后复制

您需要按如下方式编辑您的存储库源文件:

sudo nano /etc/apt/sources.list
登录后复制

然后输入

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

登录后复制

然后运行

Cutout老照片上色
Cutout老照片上色

Cutout.Pro推出的黑白图片上色

Cutout老照片上色 20
查看详情 Cutout老照片上色
sudo apt update
登录后复制

之后你现在应该可以安装你的php版本了,以8.3为例

sudo apt install php8.3
登录后复制

如果您已经安装了其他一些php,您可能需要使用
更改为版本

sudo update-alternatives --config php
登录后复制

按照提示操作

您也可以考虑安装以下扩展

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

登录后复制

以上就是在 ubuntu 上安装 PHP //的详细内容,更多请关注php中文网其它相关文章!

相关标签:
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:dev.to网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号