views:

76

answers:

4

Here in the tutorial on PHP I read:

If your server supports PHP you don't need to do anything.

Just create some .php files in your web directory, and the server will parse them for you. Because it is free, most web hosts offer PHP support.

However, if your server does not support PHP, you must install PHP.

  1. Firstly, I am not quite sure what it means to "install PHP" here. (How can a programming language be installed?)

  2. Secondly, does this mean that I can go to any free host, even a host that doesn't support PHP, "install PHP" on it and it will start doing all PHP tasks for me?

+1  A: 

The webservers doesn't know what to do with PHP files, therefore you have to tell it to direct those requests to the PHP interpreter, which you need to install seperately.

Your webhost needs to have this installed, it's not something you can do yourself on a shared webhost.

You can find more information here:

http://nl3.php.net/manual/en/intro-whatcando.php

Matthias Vance
Thank you very much!!!
brilliant
+1  A: 
  1. Yes a programming language can be installed (or more precisely, the support files for compiling/interpreting a language are). On Linux machine, installing Apache & PHP is done through either apt-get (Ubuntu) or yum (Fedora).

    On Windows machines, you can get a Apache& PHP setup quite easily: just grab WAMP.

  2. No you cannot go to any "free host" and expect to install stuff as you wish. Usually you get what you pay for: free hosting -> less degrees of liberty.

jldupont
You cannot install a programming language, but you can install support for it being interpreted/compiled etc.
Matthias Vance
@Matthias: you are being pedantic here.
jldupont
Yeah.. way pedantic.
meder
I see. Now I understand.
brilliant
i disagree, the question asked how can a programming language be installed, and the answer is it cant
Shawn Simon
I am sorry, you may say he was pedantic, but to me he in fact made it clear what "to install a programming language" means.
brilliant
+1  A: 
  1. PHP Installing means either manually compiling the source code ( common if you're setting up a customized PHP on the server ), or more practically downloading packages such as php5, php5-common and related packages with a tool such as yum or apt-get ( at least on Linux ).

  2. You can't install PHP on a free shared host, you can install PHP on a server that you have root access to, such as a dedicated or VPS server.

meder
+2  A: 

Installing a programming language is the same as installing other software. The difference is the place where you install it. Usually shared hosting servers have it installed and if they don't you probably can not do that by yourself. So, since there is a lot of options you can choose one that has.

If you, for example, want to install it somewhere where you are allowed to (your machine :) there are different options

1) Windows - download binary and click and install.
2) *Nix - automatic installation - use some package manager tool like yum or apt-get to install binaries that are already prepared for you
3) *Nix - build it by yourself by make tools provided on the system you are running.

I have never compiled and built it on windows so I don't know how it works there ;)

Source and binaries are here - http://www.php.net/downloads.php

You can find more info about installing and configuring php here http://php.net/manual/en/install.php

ivanjovanovic
Thank you, ivanjovanovic!!!
brilliant