How to compile and use php extensions on Mac OS Mojave

After days and days trying to get intl to work with the built-in php I ended up with a robust solution!

First I must say that this answer has nothing to do with code signing!

Here is what I have done, I ignored the built-in package( php, apache ) and compiled both from source and now I have the latest version of both installed with intl extension running like a charm, building new extensions is a piece of cake and php runs them without nagging :)

I don't really understand why people use homebrew for such a thing while you can easily compile libraries and extensions yourself.

I hope this answer helps someone out there.