Hello Aneeshkt.
Firstly, Can you please share the detailed error regarding "php is not working apache2 web server"?
Secondly, based on the error "Nothing Provides 'php-modephp'", which could be supposed that there is no such available package for bitbake to build. I would recommend that you refer to the link OpenEmbedded Layer Index - meta-webserver where you will find those respective layers and recipes to build it with yocto.
Please feel free to reach to us, if you have further question.
Best Regards
Harvey