mac安装php

一、安装php

brew reinstall php

 

安装完成配置:

==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/php-8.0.11_
Already downloaded: /Users/huangdan07/Library/Caches/Homebrew/downloads/5f7fe12c310bba3fb550de97deff649d509fd63803b180f48fa768ca94e41d71--php-8.0.11_1.arm64_big_sur.bottle.tar.gz
==> Reinstalling php
==> Pouring php-8.0.11_1.arm64_big_sur.bottle.tar.gz
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set php_ini /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set php_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set doc_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set ext_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set bin_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set data_dir /opt/homebrew
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set cfg_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set www_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set man_dir /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set test_dir /opt/homebrew
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear config-set php_bin /opt/homebrew/
==> /opt/homebrew/Cellar/php/8.0.11_1/bin/pear update-channels
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/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/

To start php:
brew services start php
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
==> Summary
🍺 /opt/homebrew/Cellar/php/8.0.11_1: 500 files, 78.0MB

 

 

Build process completed successfully
Installing '/opt/homebrew/Cellar/php/8.0.11_1/pecl/20200930/xdebug.so'
install ok: channel://pecl.php.net/xdebug-3.1.1
Extension xdebug enabled in php.ini

 

重定向到:/opt/homebrew/lib/php/pecl/20200930/xdebug.so

 

二、运行php

cd /opt/homebrew/Cellar/php/8.0.11_1/bin
php -f /opt/homebrew/var/www/index.php

 

 

 
 
posted @   larybird  阅读(1269)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示
点击右上角即可分享
微信分享提示