When I run the command
php -v
this error comes up
PHP Warning: PHP Startup: Unable to load dynamic library \'/usr/
Buddy, I had the same issue. Just goto your /etc/php/7.*/cli/php.ini file and comment out extension=modulename. This solution is for php version 7+.
/etc/php/7.*/cli/php.ini
extension=modulename
Up-vote will be appreciated.