macOS 10.15 already comes with php located at /usr/bin/php but it is not possible to install extensions. One way to tackle this is to use homebrew which will help with not only php extensions but a whole lot more. This post is for those who would like to achieve the said goal without homebrew.