How I Fixed: cannot open shared object file

I recently updated all my Ansible build scripts to PHP7, and shortly after, my built boxes started throwing this annoying error:

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

There’s no indication as to where this  file is attempted to be loaded from.

I am using an Ubuntu box and all I could find was help for CentOS. Dammit, I have been meaning to make the switch for a while now, but I just haven’t yet found the time.

Anyway, after a bit of Google-fu, I found a quick way to find the file:

$ grep -Ril "" /etc/php

And from there, the fix is easy:

$ vim /etc/php/7.0/cli/conf.d/20-apcu.ini

and inside the file, comment out the line mentioning

 1 ;

Problem solved.

Published by

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.