PHP tweaks

Some PHP tweaks to make the Drupal build work correctly