I have a PHP Web Application hosted in a site which consumes REST API. I would like to know whether it is possible to host that application in SharePoint? I know you could use Page Viewer Web Part. But then the application should be still hosted on some other site. Is it possible? If not, can any other(programming language) custom based web application be hosted in SharePoint.
It sounds like you already have the answer - that you can use a PageViewerWebPart - and show the PHP content within SharePoint.
And yes - it would still be hosted on the other server.
You can show any HTML content within a PageViewer or ContentEditor WebPart - what exactly are you trying to do ?
The Microsoft stack serves ASPX pages from the IIS server on a Windows machine
PHP is a different technology
You can configure your IIS server to serve PHP pages but it requires PHP to be installed on that Windows server.