Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:
1. Is this reproducible?
2. If so, what specific steps should we take to recreate this bug? Be as detailed as possible.
This will help us to find and resolve the problem.

The patch only adds header files to php5 sources: "ext/zlib/zconf.h" and "ext/zlib/zlib.h"
But in my env, it also exists "/usr/include/zconf.h" and "/usr/include/zlib.h" by standard package "zlib1g-dev".

I don't know why the existence of the header files changes the build condition...