@Kanishka Withanawasam , Apologies for the delay from over the weekend.
If you haven’t checked/done this already - By default, Azure App Service points the root virtual application path (/) to the root directory of the deployed application files (sites\wwwroot).
So, you may instead try to change the path in the required statement to the absolute path of the common_files folder.
For example:
<head>
<?php require('/home/site/wwwroot/mainFolder/common_files/headfiles.php') ?>
</head>
I see that you have posted the question on SO, as well. And, it looks like the WebApp is loading fine.
Kindly let us know, I’ll be more than happy to assist you further. Thanks for your patience!