开发者

Installing PHP on a server, what does that mean?

开发者 https://www.devze.com 2022-12-12 17:31 出处:网络
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

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, yo开发者_如何学运维u 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?


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


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


  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.


  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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号