Mac配置Swoole开发环境

1,安装 homebrew
2,安装 PHP 7.2,autoconf,openssl,redis

brew install [email protected]
brew install autoconf
brew install openssl
brew install redis

3,下载 hiredis,解压后进入相应目录

make && make install

4,下载 swoole,解压后进入相应目录

/usr/local/Cellar/[email protected]/7.2.16/bin/phpize
./configure --with-php-config=/usr/local/Cellar/[email protected]/7.2.16/bin/php-config --enable-mysqlnd --enable-openssl --with-openssl-dir=/usr/local/opt/openssl
make && make install
cd /usr/local/etc/php/7.2
vim php.ini

5,在php.ini 文件中添加:extension=swoole
6,调整php版本

vim ~/.bash_profile

添加:export PATH=/usr/local/Cellar/[email protected]/7.2.16/bin:$PATH

source ~/.bash_profile

7,验证

php -m

或者

php --ri swoole

你可能感兴趣的:(Mac配置Swoole开发环境)