国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

MAC 安裝PHP及環(huán)境配置 保姆級(jí)別

這篇具有很好參考價(jià)值的文章主要介紹了MAC 安裝PHP及環(huán)境配置 保姆級(jí)別。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

1、首先命令行進(jìn)行安裝

brew install php@8.0

第一次安裝可能會(huì)出現(xiàn)的問題

a、安裝版本問題

Warning: No available formula with the name "php@8.4". Did you mean php@8.1, php@8.0 or php@7.4?
==> Searching for similarly named formulae and casks...
==> Formulae
php@8.1                                                             php@8.0                                                             php@7.4

To install php@8.1, run:
  brew install php@8.1

出現(xiàn)該問題的原因安裝的版本問題,根據(jù)提示進(jìn)行下載安裝對(duì)應(yīng)的版本即可

b、出現(xiàn)error

fatal: not in a git directory
Error: Command failed with exit 128: git

解決辦法:直接運(yùn)行brew -v

brew -v
mark@192 ~ % brew -v
Homebrew 4.0.19-9-g8aaf99e
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:

	git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:

	git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)

看到有兩個(gè)git config,分別運(yùn)行一下即可,如下

mark@192 ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
mark@192 ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

完成之后在運(yùn)行:arch -arm64 brew install cocoapods?

mark@192 ~ % arch -arm64 brew install cocoapods

運(yùn)行結(jié)果

==> Downloading https://formulae.brew.sh/api/formula.jws.json
###################################################################################################################                                                                                    58.8%curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds

Warning: formula.jws.json: update failed, falling back to cached version.
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##################################################################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
##################################################################################################################################################################################################### 100.0%
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
==> Fetching dependencies for cocoapods: libyaml, ca-certificates, openssl@1.1, readline and ruby
==> Fetching libyaml
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libyaml-0.2.5.arm64_ventura.bottle.tar.gz
##################################################################################################################################################################################################### 100.0%
==> Fetching ca-certificates
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ca-certificates-2023-01-10.all.bottle.tar.gz
Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/08486bb5b9927def5c947c5a9e4a873eacd6364ac9cf6e50bfe3aa0bfc1c63ed--ca-certificates-2023-01-10.all.bottle.tar.gz
==> Fetching openssl@1.1
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/openssl%401.1-1.1.1t.arm64_ventura.bottle.tar.gz
Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/339aa132aee19ced825e32e534324ac7fddc1948efbf19216760c835d71c395b--openssl@1.1-1.1.1t.arm64_ventura.bottle.tar.gz
==> Fetching readline
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/readline-8.2.1.arm64_ventura.bottle.tar.gz
Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/61eadcc12bccc526220de0af71471c1f84d36861ce68a1e85979887e904b4e56--readline-8.2.1.arm64_ventura.bottle.tar.gz
==> Fetching ruby
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ruby-3.2.2.arm64_ventura.bottle.tar.gz
##################################################################################################################################################################################################### 100.0%
==> Fetching cocoapods
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/cocoapods-1.12.1.arm64_ventura.bottle.tar.gz
##################################################################################################################################################################################################### 100.0%
==> Installing dependencies for cocoapods: libyaml, ca-certificates, openssl@1.1, readline and ruby
==> Installing cocoapods dependency: libyaml
==> Pouring libyaml-0.2.5.arm64_ventura.bottle.tar.gz
??  /opt/homebrew/Cellar/libyaml/0.2.5: 10 files, 351.2KB
==> Installing cocoapods dependency: ca-certificates
==> Pouring ca-certificates-2023-01-10.all.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
??  /opt/homebrew/Cellar/ca-certificates/2023-01-10: 3 files, 216.8KB
==> Installing cocoapods dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1t.arm64_ventura.bottle.tar.gz
??  /opt/homebrew/Cellar/openssl@1.1/1.1.1t: 8,101 files, 18MB
==> Installing cocoapods dependency: readline
==> Pouring readline-8.2.1.arm64_ventura.bottle.tar.gz
??  /opt/homebrew/Cellar/readline/8.2.1: 50 files, 1.7MB
==> Installing cocoapods dependency: ruby
==> Pouring ruby-3.2.2.arm64_ventura.bottle.tar.gz
??  /opt/homebrew/Cellar/ruby/3.2.2: 16,605 files, 48.3MB
==> Installing cocoapods
==> Pouring cocoapods-1.12.1.arm64_ventura.bottle.tar.gz
??  /opt/homebrew/Cellar/cocoapods/1.12.1: 13,430 files, 27.8MB
==> Running `brew cleanup cocoapods`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

完成之后,接著去安裝就好了

2、配置環(huán)境?

安裝完成之后,這個(gè)時(shí)候直接 php -v 是無(wú)法找到這個(gè)命令的

zsh: command not found: php

需要把這個(gè)安裝好的php配置到運(yùn)行環(huán)境

vi ~/.bashrc

在安裝完php的時(shí)候,最后部分有提示

==> php@8.0
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /opt/homebrew/opt/php@8.0/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.0/

php@8.0 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have php@8.0 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/php@8.0/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/opt/homebrew/opt/php@8.0/sbin:$PATH"' >> ~/.zshrc

For compilers to find php@8.0 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/php@8.0/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/php@8.0/include"

To start php@8.0 now and restart at login:
  brew services start php@8.0
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php@8.0/sbin/php-fpm --nodaemonize

把下面兩行放到 打開的bashrc文件中

export PATH="/opt/homebrew/opt/php@8.0/bin:$PATH"

export PATH="/opt/homebrew/opt/php@8.0/sbin:$PATH"

:wq 保存并退出

bashrc是不會(huì)自己保存生效的

需要:source ~/.bashrc 最后到這里,你自己安裝的PHP環(huán)境就OK了文章來源地址http://www.zghlxwxcb.cn/news/detail-671793.html

mark@192 ~ % php -v          
PHP 8.0.28 (cli) (built: Feb 14 2023 15:42:52) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.28, Copyright (c), by Zend Technologies

到了這里,關(guān)于MAC 安裝PHP及環(huán)境配置 保姆級(jí)別的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Mac上使用phpstudy+vscode配置PHP開發(fā)環(huán)境

    Mac上使用phpstudy+vscode配置PHP開發(fā)環(huán)境

    1、系統(tǒng)版本 2、vs code code 3、phpstudy_pro 1、vs code下載 點(diǎn)擊vs code官網(wǎng)下載 選擇對(duì)應(yīng)的版本,一般電腦會(huì)自動(dòng)識(shí)別對(duì)應(yīng)的版本,點(diǎn)擊下載,然后傻瓜式安裝! 2、vs code 的插件安裝 點(diǎn)擊下面的圖標(biāo),擴(kuò)展 搜索“Chinese”,然后點(diǎn)擊“install”,等待安裝 安裝完成右下角顯示,點(diǎn)擊

    2024年01月23日
    瀏覽(21)
  • Mac上Maven的安裝和環(huán)境變量配置保姆級(jí)教程(最新版實(shí)時(shí)更新)

    Mac上Maven的安裝和環(huán)境變量配置保姆級(jí)教程(最新版實(shí)時(shí)更新)

    目錄 一、Maven的安裝 1.進(jìn)入官網(wǎng)(Maven官網(wǎng))下載安裝包并解壓 2.這里我使用了Homebrew安裝Maven 安裝Homebrew: 安裝Maven: 二、Maven配置環(huán)境變量 1.打開環(huán)境變量文檔: 2.在彈出文檔結(jié)尾加入配置: 3.保存變量配置: 4.驗(yàn)證安裝結(jié)果: 三、配置本地倉(cāng)庫(kù) 1.什么是本地倉(cāng)庫(kù) 2.配置步

    2024年04月25日
    瀏覽(21)
  • Mac 安裝php多版本,brew安裝php8.0

    Mac 安裝php多版本,brew安裝php8.0

    ?因?yàn)樾枰乙趍ac上裝兩個(gè)php版本,先前我已經(jīng)裝過php7.4,下面我們逐步安裝php8.0 直接運(yùn)行安裝? brew install php@8.0 遇到問題懷疑是倉(cāng)庫(kù)太老了,更新一下homebrew ,重新安裝 brew update 安裝成功了,不過看了下版本好像不能正常打印版本了 ?報(bào)錯(cuò)相關(guān)文檔,查詢了下好像是icu4c 這個(gè)

    2024年02月10日
    瀏覽(38)
  • mac 安裝 php 8.1

    mac默認(rèn)安裝的php版本可能偏低,可以按照以下步驟安裝最新的php 8.1。 首先安裝homebrew,如已經(jīng)安裝,忽略 將 php 8.1 的路徑添加到 PATH 查看php版本,可以發(fā)現(xiàn)php已經(jīng)是新版本了 php -v 查看PHP的服務(wù) brew services list php --ini 配置文件 /opt/homebrew/etc/php/8.1/php.ini 附加.ini 配置文件目錄

    2024年02月07日
    瀏覽(19)
  • Mac PHP7.4安裝

    查看可按照版本: 使用brew安裝: 但報(bào)錯(cuò): Error: php@7.4 has been disabled because it is a versioned formula! 這是因?yàn)閜hp7.4官方已經(jīng)不再維護(hù),所以Hombrew將該php版本移出了repository,所以安裝不了。 解決方案 從第三方倉(cāng)庫(kù)中安裝 比如(所有舊版php倉(cāng)庫(kù)地址https://github.com/shivammath…)

    2024年02月13日
    瀏覽(17)
  • mac安裝php的redis擴(kuò)展

    mac安裝php的redis擴(kuò)展

    1,下載php-redis 2,安裝并編譯 3,修改php.ini 4,驗(yàn)證是否安裝成功 打開phpinfo頁(yè)面,查找Redis選項(xiàng),如下圖代表安裝成功。 ?

    2024年02月13日
    瀏覽(24)
  • mac brew 安裝php7.4

    查看可按照版本: brew search php 使用brew安裝: brew install php@7.4 但報(bào)錯(cuò): Error: php@7.4 has been disabled because it is a versioned formula! 這是因?yàn)閜hp7.4官方已經(jīng)不再維護(hù),所以Hombrew將該php版本移出了repository,所以安裝不了。 解決方案 從第三方倉(cāng)庫(kù)中安裝 比如(所有舊版php倉(cāng)庫(kù)地址https

    2024年02月10日
    瀏覽(19)
  • 保姆級(jí)別——Android Studio安裝教程&環(huán)境變量配置

    保姆級(jí)別——Android Studio安裝教程&環(huán)境變量配置

    1.1 官網(wǎng)下載地址: Download Android Studio and SDK tools ?|? Android Developers 1.2 找到下載好的安裝包,雙擊,再按以下步驟操作。 1.3?這里點(diǎn)擊Browse更換安裝路徑(推薦),也可以安裝在默認(rèn)路徑下。 1.4 安裝完成后勾選Start Android Studio啟動(dòng)并點(diǎn)擊finish。? 1.5 啟動(dòng)完成選擇不導(dǎo)入配置,然

    2024年02月16日
    瀏覽(27)
  • Mac m1 安裝rabbitmq+php-amqplib

    Mac m1 安裝rabbitmq+php-amqplib

    rabbitmq 官方地址?https://www.rabbitmq.com mac 軟件包?Downloading and Installing RabbitMQ — RabbitMQ 一.這里我選擇 homebrew? 二.php代碼 用composer 安裝 10年軟件開發(fā)經(jīng)驗(yàn),結(jié)交朋友! 分銷商城系統(tǒng)開發(fā),App商城開發(fā) 商務(wù)合作 samshop168 歡迎私信,必回

    2024年02月09日
    瀏覽(13)
  • Mac系統(tǒng)配置環(huán)境變量保姆級(jí)教程

    Mac系統(tǒng)配置環(huán)境變量保姆級(jí)教程

    1、下載好相關(guān)安裝包 2、打開終端,輸入命令轉(zhuǎn)到系統(tǒng)環(huán)境變量配置文件 輸入密碼(密碼不顯示,實(shí)際上已經(jīng)在輸入了)? 3、替換配置文件中PATH后的部分,改為包的位置,按鍵盤a進(jìn)入編輯模式 即替換/Library/Frameworks/Python.framework/Versions/3.7/bin為自己電腦中的位置 ?4、修改好

    2024年02月11日
    瀏覽(29)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包