dragon19720808 2019-06-08 16:50
浏览 2032

PHP启动:无法加载动态库'mysqli'未定义符号:mysqlnd_global_stats

My entire site runs flawlessly via browser. I have just added a cron job, and each time it runs this error gets triggered:

PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20180731/mysqli (/usr/lib/php/20180731/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: undefined symbol: mysqlnd_global_stats))

Not sure what is going on. I have logged PHP version both using the browser, and using cron, and it came out the same: 7.3.2-3+0~20190208150725.31+stretch~1.gbp0912bd

What is so different in cron? How can i fix this?

  • 写回答

1条回答 默认 最新

  • duanjiani6826 2019-06-08 17:09
    关注

    I have 2 solutions.

    Solution one: I noticed that closing the mysql connection at the end of the script solves the problem.

    Solution two: As it turns out, there was a difference between /etc/php/7.3/cli/php.ini and /etc/php/7.3/fpm/php.ini.

    The first one has this line:

        extension=mysqli
    

    The second one hat this (note the semicolon):

    ;    extension=mysqli
    

    Adding the semicolon to /etc/php/7.3/cli/php.ini completly fixed my issue.

    评论

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配