Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

opilo's avatar

PHP Warning: PHP Startup: Unable to load dynamic library

I updated my server using these two commands:

sudo apt-get update
sudo apt-get upgrade

Now there is a PHP warning in my deployment log:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/zlib.so' - /usr/lib/php/20151012/zlib.so: cannot open shared object file: No such file or directory in Unknown on line 0

Any idea how i can fix this? Thanks

0 likes
11 replies
richwilliamson's avatar

Run this "grep extension /usr/local/lib/php.ini" and see you have an empty "extension =" lines in your php.ini file. Note that the location of your php.ini might be different to /usr/local/lib/ so you might need to google where your ini file is. If you have any empty extension lines, remove them.

opilo's avatar

Same OS, Same PHP version and already checked for empty Extension.

richwilliamson's avatar

I've not taken the plunge with PHP 7 yet but it's possibly a bug. I take it the recent update pulled down an update to PHP7?

Try turning off a couple of sqlite options in your ini file.

;;extension=pdo_sqlite.so ;;extension=sqlite.so

timothyrowan's avatar

Updated this morning with apt-get and the issue has been resolved.

opilo's avatar

Can you write the full command please. Thanks

timothyrowan's avatar
Level 3

just apt-get update and upgrade like you did before. looks like the issue was fixed in the php7 package

bulgaria_mitko's avatar

in my case i just commented (;) the path to the extension and the error went away

1 like

Please or to participate in this conversation.