I run MAMP, so my site sits in a subdirectory folder. Example: http://mysite.com/myfolder/test.php
test.php, meta_tags.txt, get_meta.php are on the same level.
In the meta_tags.txt file, I could have prepended 'myfolder' in front of all my page files to make this work. Example: myfolder/test.php
However that's counterproductive. Hawkee mentioned "strip the directory from $page"
However, I'm not fluent in PHP, so I didn't know how to do handle precisely. I searched the web for awhile to find a "solution."
Since the fix wasn't illustrated in this post, here is the solution that worked for me:
Comment out, but don't delete since you may need it later:
$page = substr($page, 1);
Add this snippet just below:
$page = ltrim(strrchr($_SERVER['PHP_SELF'], '/'), '/');
Basically, that seems to remove the subdirectory name from the path in order to make adding dynamic meta tags possible.