MAC中PHP7.3安装mysql扩展

1.下载mysql扩展
http://git.php.net/?p=pecl/database/mysql.git;a=summary

2、解压
tar xzvf mysql-d7643af.tar.gz

3、进入mysql扩展目录
cd mysql-230a828/

4、使用phpize初始化
/usr/local/Cellar/[email protected]/7.3.16/bin/phpize

5、编译mysql扩展,使用mysql native driver作为mysql链接库
./configure --with-php-config=/usr/local/Cellar/[email protected]/7.3.16/bin/php-config --with-mysql=mysqlnd
make && make install

6、编辑php.ini文件(/usr/local/etc/php/7.3/php.ini),在php.ini中加入extension=mysql.so

7、重启php-fpm,查看phpinfo()是否已经加上扩展

猜你喜欢

转载自www.cnblogs.com/gaocy/p/12566155.html