VirtualBox + Vagrant + homesteadbox 环境下 yaf 的安装
下载 Yaf 的最新版本, 解压缩以后, 进入 Yaf 的源码目录, 依次执行:
phpize
./configure --with-php-config=/usr/bin/php-config7.2
make
make install
如果 make install
后报错类似:
cannot create regular file '/usr/lib/php/20170718/#INST@30150#': Permission denied Makefile:87: recipe for target 'install-modules' failed make: *** [install-modules] Error 1
需要权限,试试 sudo make install
然后在php.ini中载入 yaf.so :vim /etc/php/7.2/fpm/php.ini
文件处于不可编辑状态,按“i”键后才能编辑,加入:
[yaf]
extension=yaf.so
编辑完后按ESC键然后输入 :wq!
保存文件并退出时报错:
Can't open file for writing
输入 :qw!
取消改动退出编辑器,然后执行:sudo vim /etc/php/7.2/fpm/php.ini
配置成功后,重启虚拟机,用官网的 hello world 测试扩展安装成功。
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: