Add error checking and messaging to build script and php file.