In the file you want to access via php:
File -> Manage -> Security...
Under 'Extended Privileges' there should be one called fmphp. Click on it and click 'Edit...' button. Check off who should have access via php. This isn't setup by default.
All you need to do to have a DB accessible to PHP is give one of the Privilege Sets access to PHP in the extended privileges.