I suspect the extension doesn’t yet support PHP 7.2.
The last changelog only announces provisional support for PHP 7.0
GitHub - mgdm/Mosquitto-PHP: A wrapper for the Eclipse Mosquitto™ MQTT client library for PHP.
/usr/lib/php/20170718/ is PHP 7.2’s location, If the extension is still installing to /usr/lib/php/20151012/ which is the PHP7.0 location it is most likely oblivious to PHP 7.2.
The jump from 5.6 to 7.0 is only just gathering speed, trying to use 7.2 will no doubt uncover many quirks, is there a reason you need 7.2, unless it’s changed in the last 2 month’s, 7.0 is the default for 16.04. which ASAIK is still the mainstream “latest” release, I know 18.04LTS is released, but it’s not yet the default “current version”.