Build a REST API with PHP on LAMP: where to put php sources?
There are many tutorials around how to build a REST API in php, but they all seem to be either focused on using XAMPP (i.e. they explain where to put the PHP sources for XAMPP only, referring to the htdocs
-folder) or they completely skip such explanations. So my question is: when I am working on a LAMP-stack on Ubuntu where websites and php scripts to be viewed/executed on localhost are “deployed” to /var/www/html
, where do I have to put the code for the REST API, to be able to use it on localhost? I tried to put them into /var/www
or /var/www/html/
but that did not work. Any hints would be appreciated!