php - 如何在 homestead 中更新 PHP 版本

标签 php laravel homestead

我在更新 homestead 中的 php 版本时遇到了问题。当我在 homestead ssh 中检查版本时,它说它的 php 版本是 PHP 5.6.23-1+deprecated+dontuse+deb.sury.org~trusty+1 (cli)。现在我想将 PHP 版本更新为 7 以实现代码兼容性。有解决此问题的简单方法吗?

我也试过这个来自 here 的 但没有运气。谢谢

最佳答案

升级 laravel/homestead box 本身

$ vagrant box update

ssh进入虚拟机

$ vagrant ssh

升级一切

$ sudo apt-get update
$ sudo apt-get upgrade

关于php - 如何在 homestead 中更新 PHP 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40101201/

相关文章:

涉及连字符的 PHP MySQL 语法错误

php - 搜索页面加载速度极慢(MySQL 和 PHP)

php - 根本原因拥有的 Laravel Storage Cache 文件夹无法清除缓存

php - PHP Laravel 查询生成器中的 SQL 语法 PostgreSQL 与 MySQL

node.js - Laravel 5 - Homestead - Redis - NodeJs - Socket IO 运行不正常

php - 检查选定的项目列表是否在另一个表中

没有 Composer 的 PHPMailer 安装

php - 无法让 Laravel 中间件 "can:something"与我的策略配合使用

php - 您的 Composer 依赖项需要 PHP 版本 ">= 8.0.0"。您正在运行 7.4.11

laravel - 尝试设置 Homestead 时 bash init.sh 没有创建我的 homestead.yaml 文件