PHP reads configuration from php.ini and from other .ini files depending on the server's operating system and configuration. So it's sometimes difficult to describe exactly where changes should be made.
However from your screenshot OPcache is enabled and running so you're most of the way there. You don't need zend_extension=/full/path/to/opcache.so.
The only thing you should do is check the OPcache settings shown in your PHP info match the recommended settings:
(The link to the OPcache documentation in the Ubuntu page was to the old Moodle 2.6 page, …/26/en/OPcache. I've updated this so it links to the current version of the OPcache page).