LAMP is all about layers. Passing data from a database up to a client. Each layer is responsible for translating the data from its source, to be ready for its destination.
This is similar to the ISO model. Or is that OSI? The 7 layers (which may not be correct).
You may say Linux and Apache are layers 1-3
PHP could be layers 4-6
MySQL could be layers 2 and 3