鍍金池/ 問答/Java  PHP/ PHP Warning: PHP Startup: Unable to loa

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
十萬火急,網(wǎng)上找不到解決方案。項目就這樣崩潰在那里,求助各位好友

回答
編輯回答
離殤

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

2018年8月5日 07:56
編輯回答
情殺

so擴展文件找不到,說明路徑不對,確認(rèn)下具體路徑在什么地方。如果不知道可以看看其擴展文件在哪。改為相同的再試試。

2018年1月30日 17:04