🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 常见错误 [TOC] ## make或make install无法执行或编译错误 NOTICE: PHP message: PHP Warning: PHP Startup: swoole: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20121212 These options need to match in Unknown on line 0 php版本和编译时使用的phpize和php-config不对应,需要使用绝对路径来进行编译。使用绝对路径执行PHP。 ~~~ /usr/local/php-5.4.17/bin/phpize ./configure --with-php-config=/usr/local/php-5.4.17/bin/php-config /usr/local/php-5.4.17/bin/php server.php ~~~ ## 缺少mysql头文件 ~~~ php_mysqli_structs.h:64:23: fatal error: my_global.h: No such file or directory ~~~ 没有找到`mysqlclient`的头文件,需要安装`mysqlclient-dev` > 建议自行编译php,不要使用Linux包管理系统自带的php版本 ## 缺少pcre.h头文件 ~~~ fatal error: pcre.h: No such file or directory ~~~ 原因是缺少pcre,[需要安装libpcre](pcre.hNosuchfileordirectory.md) ## Cannot find autoconf phpize命令需要`autoconf`工具,请先安装它。 ## make install失败 make install需要root权限,如果不是以root用户登录的,请用sudo或su,再进行安装。 ## 修改了php.ini后,php -m或phpinfo中没有swoole [请移步该文档](在phpinfo中有在php-m中没有.md) ## 缺少hiredis.h 编译配置时启用`--enable-async-redis`,但没有安装`hiredis`库,编译时会报`fatal error: 'hiredis/hiredis.h' file not found`,请安装`hiredis`库或者去掉`--enable-async-redis`选项。 ## error: too many arguments to function 'zend\_exception\_error' 你的PHP版本低于PHP-5.3.10,请升级PHP版本。 ## 如果还是编译失败了怎么办? 不要气馁,加入我们的[Swoole官方QQ群](Swoole社区.md),你的问题会在24小时内被解决。