[4.0] Fixed warnings when open_basedir directive set

Same as #185 but for the 4.0 branch.