The first available PHP program-from configuration to Hello World

Source: Internet
Author: User
Tags win32

Long time ago wanted to see something of PHP, to tell the truth, today it took so long to explore the running out of PHP really a bit embarrassed. First want to use PHP is to want to know more things, do not know now only to build up the environment, although roughly understand a little basic things, but still in the lowest state.

Here is the first thing that can be run, of course, for the first level of things, that is, from the environment configured to run a PHP page effect.

Go straight to the subject. The first is downloading. Apache_2.0.63-win32-x86-no_ssl.msi (http://httpd.apache.org/download.cgi). Php-5.2.10-win32.zip (Http://cn.php.net/get/php-5.2.10-Win32.zip/from/a/mirror). These are up to date Apache2.0 up-to-date. and PHP5.2 up to date. (here to say why not Apache2.2 it, because with 2.2 when there are a lot of problems, such as online said compatible or patched, or, in short, the problem repeatedly ... ) so it took 2.0. (There is no PHP5.3, but also due to the installation of a considerable problem, so it is recommended that you just start to download the decompression version of it, this will be a lot less problem.) )

With these two is enough (temporarily for the first PHP program),

  

First: Configure PHP to extract PHP into a directory. Here I am d:/php, (again explain, I have a very bad problem, is like to put a lot of things down to the program directory, because there are spaces, so it caused a lot of problems. ) after decompression. Find "Php.ini-dist" file, renamed to "PHP.ini", this is actually (initialization parameters) configuration file, (we recommend to see Http://www.phpchina.com/html/81/n-13681.html) directly have all the content. Oh, but still a little bit, because at least their own manual to practice a. Of course not configured MySQL, it is already good, haha. Here point two: the value of 1,register_globals =. It is related to form delivery references. 2,extension is also the add-in. Then there is the configuration environment variable (important). D:/php and D:/php/ext are added directly to the environment variables.

Second: Configure Apache, installation, in the input domain name, you can enter 127.0.0.1 on it, here is the direct test on this machine, enough. Then configure it. There are two places to go: 1, find the apache2/conf directory and open httpd.conf, then add LoadModule php5_module after LoadModule Php5apache2.dll, interlace phpinidir "d:/php", where the directory to note is your directory, meaning that the previous one is a module to load PHP, and is the PHP configuration file under D:/php, this is obvious. 2, find AddType place, add "AddType application/x-httpd-php. php" and "AddType application/x-httpd-php. html" in the back, and then start Apache, See the problem no, no problem, congratulations, almost.

The next step is the experimental program.

<title>

I PHP

</title>

<body>

<?php

Echo ' HELLO world '

Phpinfo ();

?>

</body>

Open the browser, enter http://127.0.0.1/firstphp.php, and see what appears.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.