PHP Warning: PHP Startup: Unable to load dynamic

我查看php版本的时候,提示我错误

PHP Warning: PHP Startup: Unable to load dynamic library 'bz2.so' (tried: /usr/lib/php/20170718/bz2.so (/usr/lib/php/20170718/bz2.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/bz2.so.so (/usr/lib/php/20170718/bz2.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.2.3-1+ubuntu17.10.1+deb.sury.org+1 (cli) (built: Mar 6 2018 11:19:27) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

with Zend OPcache v7.2.3-1+ubuntu17.10.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

clipboard.png
十万火急,网上找不到解决方案。项目就这样崩溃在那里,求助各位好友

阅读 3.2k
2 个回答

so扩展文件找不到,说明路径不对,确认下具体路径在什么地方。如果不知道可以看看其扩展文件在哪。改为相同的再试试。

Sometimes people here are not as they could be...

For whatever reason, your php.ini is mis-configured.

One thing to note that all those missing files are actually Windows files (.dll) on Linux these would likely be .so files. I'm assuming your hosting on a Linux server.

First find your php.ini file. If you have command line access via SSH, you can try running:

php --ini
if not you make a simple script, call it test.php like so:

<?php
phpinfo();
?>
Upload the file and run it, something like:

http://www.yoursite.com/test.php

Among the information provided will be the path to php.ini

Once you find it, one option is to edit it and comment out all those extensions, by putting a ";" in front of the line.

Another option is to check if the *.so files exist. Look for them under /usr/lib/php. If they exist, edit your php.ini file to have all those extension end in .so instead of .dll

Finally, if they don't exist, you could install them by using apt-get or yum. An example:

sudo apt-get install php-mbstring

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题