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

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 学不会递归,理解不了汉诺塔参数变化
  • ¥30 软件自定义无线电该怎样使用
  • ¥15 R语言mediation包做中介分析,直接效应和间接效应都很小,为什么?
  • ¥15 Jenkins+k8s部署slave节点offline
  • ¥15 如何实现从tello无人机上获取实时传输的视频流,然后将获取的视频通过yolov5进行检测
  • ¥15 WPF使用Canvas绘制矢量图问题
  • ¥15 用三极管设计一个单管共射放大电路
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)