如果你在PHP的扩展中安装了yaf却不生效,那么需要打开PHP配置,添加以下代码: [yaf] extension=yaf.so yaf.environ='product' yaf.use_namespace=1 然后重启PHP即可生效