0

Maybe it's more of a paradigmatic/philosophical question, but I'm wondering for quite some time "What do you install if you install PHP?" Is it the interpreter/compiler or the language constructs (functions, syntax elements etc.) or something completely else?

I'm not an expert at php and have no computer science so I find it hard to truly understand...

Luuk Van Dongen
  • 2,391
  • 6
  • 26
  • 40

1 Answers1

0

You are installing a PHP interpreter (it is an interpreted language on its base), along with its built-in functions (APIs provided as a library along with the language for mostly common used functionality). Also a SAPI (Server API) is installed, which allows the PHP runtime environment to be accessed through a web server.

UPDATE: In a sense, each programming language is considered being defined by the commands recognized by its interpreter/compiler. So we could say that the compiler "defines" the language, as it defines its syntax, semantics and particular behavior. I suggest that you read more about the compilers.

Community
  • 1
  • 1
Nick Louloudakis
  • 5,856
  • 4
  • 41
  • 54
  • 1
    You also install a SAPI, which allows the PHP runtime environment to be accessed through a web server (such as Apache or nginx) or from the command line, or even embedded... which SAPI (or SAPIs) will depend on your own setup – Mark Baker Jun 11 '14 at 12:25
  • So actually, there are no language instructions installed? All the language instructions 'exist' solely in the interpreter of PHP? so in other words, language changes are made in the interpreter? – Luuk Van Dongen Jun 11 '14 at 13:07
  • What do you mean by saying "installed"? An interpreter interprets commands, making syntax and semantic analysis in order to "execute" them command by command in a sense: http://en.wikipedia.org/wiki/Interpreter_%28computing%29 – Nick Louloudakis Jun 11 '14 at 13:10
  • What do you mean "real"? Think of it like this: In order to have a command executed, the computer has to "understand" it, or, as in this case, have a program able "understand" that command and make some actions. This program is the interpreter, which analyzes the command and then takes some actions defined in its behavior. This is defined in the interpreter. – Nick Louloudakis Jun 11 '14 at 13:22
  • What I mean is that the fact that the PHP interpreter does understand all those commands and functions it interprets, makes those commands and functions part of the PHP language? So actually the interpreter therefore actually is the PHP language? I know it's kinda philosophical... EDIT - That's what I meant Nick L. The computer 'understands' PHP through the interpeter, so the interpreter 'is' the PHP language – Luuk Van Dongen Jun 11 '14 at 13:29
  • Answer updated, check it out. Do not forget to upvote/vote as best answer if you find it useful. Thanks. – Nick Louloudakis Jun 11 '14 at 14:32