Sometimes you can’t just upgrade Ubuntu to >=16 which ships a LAMP with PHP 7 by default .
As a temporary solution you can upgrade your old LAMP to PHP 7 whilst keeping PHP 5.x available.
Retrieve an array with all (published) post IDs for (queryable) post types having a custom field
my_meta_field with a value (string).
When developing you might just need to clear your Apache error log files from time to time.
There is a brillant answer to this problem on Serverfault.