【问题标题】:Warning: PHP Startup: Unable to load dynamic library apc.so警告:PHP 启动:无法加载动态库 apc.so
【发布时间】:2017-04-29 07:22:27
【问题描述】:

我尝试安装APC。 我运行configure 文件,它运行正常,但是当我尝试make 时,出现以下错误:

/home/ghost/APC-3.1.13/apc_cache.c: In function ‘_apc_cache_user_update’:
/home/ghost/APC-3.1.13/apc_cache.c:818:63: error: ‘IS_CONSTANT_INDEX’ undeclared (first use in this function)
         switch(Z_TYPE_P((*slot)->value->data.user.val) & ~IS_CONSTANT_INDEX
                                                           ^
/home/ghost/APC-3.1.13/apc_cache.c:818:63: note: each undeclared identifier is reported only once for each function it appears in
/home/ghost/APC-3.1.13/apc_cache.c:820:22: error: ‘IS_CONSTANT_ARRAY’ undeclared (first use in this function)
             case IS_CONSTANT_ARRAY:
                  ^
Makefile:186: recipe for target 'apc_cache.lo' failed
make: *** [apc_cache.lo] Error 1

之后

我运行这个命令sh -c "echo 'extension=apc.so' >> /opt/lampp/etc/php.ini"

检查是否安装了 APC

/opt/lampp/bin/php -r 'echo phpinfo()' | grep apc --color

输出:

Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/apc.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0

我该如何解决?

【问题讨论】:

  • 出现构建错误,为什么要尝试加载模块?此外,您可能需要安装它。代码有错误,无法构建。
  • @iharob 是的,我该如何解决?

标签: php c caching apc


【解决方案1】:

您正在尝试使用 PHP 版本编译扩展,其中 IS_CONSTANT_INDEXIS_CONSTANT_ARRAY C 常量为 no longer available。从那时起,APC 扩展 had not been updated。该扩展程序似乎已被废弃,因为 last commit2013 年 9 月 12 日

所以你应该使用另一个缓存扩展,或者升级 APC 扩展内部。我宁愿使用自 5.5.0 版以来与 PHP 捆绑在一起的OPcache

【讨论】:

    猜你喜欢
    • 2021-08-27
    相关资源
    最近更新 更多