在 Mac 上使用 Homebrew 升级PHP到 PHP 8.1
source link: https://www.iplayio.cn/post/18964131
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
原文地址:在 Mac 上使用 Homebrew 升级PHP到 PHP 8.1
本文分享如何在 Mac 上使用 Homebrew 升级PHP版本到 PHP 8.1
使用 Homebrew 升级
首先确保 brew 是最新的:
brew update
接下来,升级PHP。您可以使用内置的 php 配方,但我建议使用shivammathur/homebrew-php
水龙头。
brew upgrade php
升级 shivammathur/homebrew-php
brew tap shivammathur/php
brew install shivammathur/php/[email protected]
要在版本之间切换,请使用以下命令:
brew link --overwrite --force [email protected]
您可以在存储库中阅读更多内容。
通过运行检查当前版本php -v
:
php -v
重启 Nginx 或 Apache,如果你使用的是 Laravel Valet,你可以跳到下一节;您需要一些额外的步骤才能使 Web 服务器正常工作。
sudo nginx -s reload
sudo apachectl restart
并通过访问此脚本确保您的本地 Web 服务器也使用 PHP 8.1:
# index.php, accessible to your web server
phpinfo();
Recommend
-
8
在 M1 芯片 Mac 上使用 HomebrewiOS话题下的优秀回答者Homebrew 是 Mac 上管理软件包的最实用工具之一。但截至目前,它还没有对搭载 Apple silicon 的新 Mac 机型完成适配。根据维...
-
21
« back — written by Brent on November 26, 2020 Upgrade to PHP 8 with Homebrew on Mac ...
-
11
« back — written by Brent on November 28, 2019 Upgrade to PHP 7.4 with Homebrew on Mac ...
-
21
« back — written by Brent on March 21, 2019 Upgrade to PHP 7.3 with Homebrew on Mac ...
-
6
« back — written by Brent on November 28, 2019 Upgrade to PHP 7.4 with Homebrew on Mac ...
-
8
« back — written by Brent on March 21, 2019 Upgrade to PHP 7.3 with Homebrew on Mac ...
-
8
« back — written by Brent on November 26, 2021 Upgrade to PHP 8.1 with Homebrew on Mac ...
-
3
Mac 下 Homebrew 搭建 PHP 开发环境 发表于 2021-07...
-
3
« back — written by Brent on November 01, 2022 U...
-
1
使用 Homebrew 升级 首先确保 brew 是最新的: brew update 接下来,升级PHP。您可以使用内置的 php 配方,但我建议使用shivammathur/homebrew-php。
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK