PHP is complied from source code.
You compiled php from source code? Why? Isn't needed and this could be the reason for your issues. Many years ago that was the only way one could get LAMP. No longer true. Binaries provided by reputable/well-known repos do just as well and are much easier to maintain and manage on your own system.
I just modified the LAMP of my boss's existing LAMP platform.