How to install php manually

How to install php manually

Installing PHP on Windows

download zip package from php home page
create c:\php
put it there and make the following configuration there
Integrating PHP with Apache on Windows
To ensure that PHP and Apache get along with one another, you need to add a few
items to the httpd.conf configuration file. First, find a section that looks like this:
# Example:
# LoadModule foo_module modules/
LoadModule access_module modules/

#LoadModule vhost_alias_module modules/
At the end of this section, add the following:
LoadModule php5_module C:/php/php5apache2_2.dll
In addition, add the following to ensure Apache knows where php.ini resides:
PHPIniDir “C:/php/”
Next, look for this section:
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
Add the following line:
AddType application/x-httpd-php .php

This statement ensures that the PHP engine will parse files that end with the .php
extension. Your selection of filenames might differ; for example, you might want to
parse all *.html files as PHP files.
Save the httpd.conf file and then restart Apache. The server should start without
warning; PHP is now part of the Apache web server.

Open a text editor and type the following line:
<?php phpinfo(); ?>

the basic php file:

<!DOCTYPE html>
2: <html>
3: <head>
4: <title>A PHP script including HTML</title>
5: </head>
6: <body>
7: <h1><?php echo “hello world”; ?></h1>
8: </body>
9: </html>

how to comment in php file:
Single-line comments begin with two forward slashes (//)—the preferred style—or a
single hash or pound sign (#). The PHP engine ignores all text between these marks
and either the end of the line or the PHP close tag:
// this is a comment
# this is another comment
If you want to do multiline comments begin with a forward slash followed by an asterisk (/*) and end
with an asterisk followed by a forward slash (*/):
this is a comment
none of this will
be parsed by the
PHP engine