首页 > 编程语言 >mac m1 安装php扩展

mac m1 安装php扩展

时间:2023-02-05 09:12:12浏览次数:48  
标签:opt 8.0 xdebug mac Cellar m1 homebrew php

安装xdebug

进入 https://pecl.php.net/package/Xdebug 选择对应的版本下载 
php8.0 下载 xdebug-3.2.0.tgz  
解压 tar -zxvf xdebug-3.2.0.tgz 
进入解压目录 执行  phpize
运行 ./configure && sudo make && sudo make install
安装成功之后 /opt/homebrew/Cellar/[email protected]/8.0.27_1/pecl/xxx  会生成对应的 xxx.so文件
方式一:
php.ini 文件引入生成的 so 文件 
	例如:extension=xdebug.so 或者 extension=xdebug

方式二:
/opt/homebrew/etc/php/8.0/conf.d/xxxx.ini  引入文件路径
	[xdebug]
	zend_extension="/opt/homebrew/Cellar/[email protected]/8.0.27_1/pecl/20200930/xdebug.so"

安装 mongodb

方式如上:
下载地址:https://pecl.php.net/package/mongodb

// 如果安装报错
Mac M1报错: fatal error: ‘pcre2.h‘ file not found 解决方案
// Cellar 后面改成自己的路径
ln -s /opt/homebrew/include/pcre2.h /opt/homebrew/Cellar/[email protected]/7.4.16/include/php/ext/pcre/pcre2.h

标签:opt,8.0,xdebug,mac,Cellar,m1,homebrew,php
From: https://www.cnblogs.com/hefeng2014/p/17092846.html

相关文章