How to compile php with additional extension

I want to run php script on AWS Lambda with Serverless framework. I compiled php binary with

--with-curl --with-openssl=PATH --with-zlib

flags, but script use redis, so I need compile php with redis extension. How can I do this?