Custom Search
 


How to install PHP server-side scripting language on Windows




PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source general-purpose scripting language that is especially suited for Web development. Its syntax draws upon C, Java, and Perl, and is easy to learn. The main goal of the language is to allow web developers to write dynamically generated web pages quickly, but you can do much more with PHP.

Why install PHP version 4 when PHP 5 is available

You may want to install an older version of PHP as many web hosting companies still use PHP version 4. To avoid any incompatibility issues between your PHP code on a development box and production box of your web hosting, use an older version of PHP is recommended.

Steps to install PHP on Windows as development machine Step 1: Download PHP Windows Binaries

  1. Go to http://www.php.net/downloads.php

  2. Move to the end of the download page where PHP 4 (e.g. 4.4.8 zip package) is listed.

  3. Go to Windows Binaries section. Click the link to open the mirror page.

  4. PHP 4.4.8 zip package download link

  5. Then choose a mirror site to download the zip package to your computer.

Step 2: Verify the installer you just downloaded.

Every PHP download comes with a MD5 hash value. This hash value is a Checksum value that can be used to verify data and file integrity. Screenshot below shows the PHP I downloaded was verified by freeware HashCalc.

File downloaded: php-4.4.8-Win32.zip
MD5 hash provided by Apache.org: 09ffff4b1a54bbadb8fee6acd85a2c1f

Verified PHP download by HashCalc
Verify PHP download by HashCalc

Step 3: Set up PHP directory

  1. Unzip the PHP package.

  2. To unzip, you can use open source file archiver 7-Zip.

  3. Create a new directory C:\php

  4. Copy all files and directories from the unzipped package to C:\php. See screenshot below.

    PHP installation directory on C drive
    PHP installation directory on C drive

  5. Copy php4ts.dll from C:\php and paste it to the following directory.

    For Windows 2000/XP, C:\WINNT\system32

    Or

    For Window 95/98/Me, C:\Windows\system

  6. Copy php.ini-dist from C:\php and paste it to either C:\WINNT or C:\Windows and then rename it to php.ini. It should end up like this:

    For Windows 2000/XP, C:\WINNT\php.ini

    Or

    For Window 95/98/Me, C:\Windows\php.ini

Step 4: Configure php.ini file

Open php.ini in your text editor and modify the values (if the value is different to the new value) listed in table below.

Because we are building a development and debugging environment, most of the default values in php.ini should be OK to use. Depending on your needs, you may want to change the following options:

Purpose Old value New value
Always display errors display_errors = Off display_errors = On
Turn on debugging on startup errors display_startup_errors = Off display_startup_errors = On
Create temporary directory for HTTP uploaded files such as uploaded photos ;upload_tmp_dir = C:\PHP\uploadtemp

Turn on GD support if you want PHP to generate graphics on the fly. For example, use GD for photo uploading script.

To use GD support, remember to copy and paste php_gd2.dll to system directory:

For Windows 2000/XP, C:\WINNT\system32
Or
For Window 95/98/Me, C:\Windows\system

;extension=php_gd2.dll extension=php_gd2.dll
Correct the extension directory in which the loadable extensions (modules) reside. extension_dir = "./"

Or

extension_dir = "./extensions"
extension_dir = "C:/php/extensions"

Create a folder (here we use C:\PHP\tmp) where session data are stored.

When you call session_start() in PHP, it will create a session file in this folder. You can open the session file to examine values in it.

;session.save_path = /tmp session.save_path ="C:\PHP\tmp"

Note:

For PHP mail function related configuration in PHP.ini, refer to the guide how to use PHP and Microsoft SMTP Server to send emails.

Copyright© GeeksEngine.com


Related Articles:

1.How to set up MySQL DSN in ODBC Data Source Administrator on Windows
2.Step by step guide on how to install Apache web server on Windows
3.How to use PHP and Microsoft SMTP Virtual Server to send emails on Windows
4.How to install PEAR on Windows
5.How to install PEAR on your shared web hosting account
6.How to use Apache Virtual Host to run multiple local websites on Windows
7.How to use Date and Time data as integer value in PHP and MySQL
8.How to create include path for PHP (five ways to do it)


Other Recent Articles from the WAMP & LAMP category:

1.How to upgrade from PHP4 to PHP5
2.How to load time zone data for MySQL on Windows
3.How to use Apache Virtual Host to run multiple local websites on Windows
4.How to install PEAR on your shared web hosting account
5.How to install PEAR on Windows
6.How to use PHP and Microsoft SMTP Virtual Server to send emails on Windows
7.Step by step guide on how to install Apache web server on Windows
8.How to install two different versions of MySQL server on the same PC
9.How to configure MySQL server 4.1 on Windows
10.How to install MySQL server 4.1 on Windows with screenshots

Copyright © 2010 GeeksEngine.com. All Rights Reserved.

This website is hosted by LunarPages.

No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it.

 
Home | Feedback | Terms of Use | Privacy Policy