Sunday, November 30, 2008

PHP with Apache installation on Windows Vista operating system

NB : Please follow this steps carefully to configure your Windows Vista with PHP and Apache. I am using Windows Vista Ultimate edition and run successfully.


File that will be used for installation :
1. apache_2.2.10-win32-x86-no_ssl.msi or click here to download the latest version of Apache
2. php-5.2.6-Win32.zip or click here to download the latest version of PHP


Before continue, make sure that :
1. Uninstall any previous Apache web server in your computer. Delete folder "C:\Program Files\Apache Software Foundation\" too.
2. Uninstall any previous PHP in your computer then delete PHP folder.
3. Turn off the Firewall via Control Panel.
4. Stop the User Account Control (UAC) via Control panel.

Installing Apache 2.2.x
1. Run the apache_2.2.10-win32-x86-no_ssl.msi setup then click Next.

2. Choose I accept the terms in the license agreement then click Next.

3. Next

4. Fill the textbox like the sample picture shown below then click Next.

5. Choose Typical setup type then click Next.

6. Make sure the default folder for installation is C:\Program Files\Apache Software Foundation\Apache2.2\ then click Next.

7. Click Install to begin the installation and please wait during the installation complete.



8. Click Finish after installation wizard completed.

9. Open your browser, then type http://localhost at address bar. If the installation success, it should be like this picture shown below.


Installing PHP5 as module
1. Extract file php-5.2.6-Win32.zip to C:\PHP\

2. Make two folder that named Sessions and Upload at C:\PHP\

3. Make a copy of file php.ini-dist, then rename it as php.ini

4. Open php.ini with Notepad or another text editor.

5. Delete the semicolon symbol (;) at the command line below as shown.
NB : symbol (;) to make inactive an command line

short_open_tag = off
asp_tags = Off
output_buffering = off
allow_call_time_pass_reference = on
error_reporting = E_ALL & ~E_NOTICE
display_errors = on
log_errors = off
variables_order = "EGPCS"
register_long_arrays = On
register_argc_argv = On
magic_quotes_gpc = On

;include_path = ".;c:\php\includes"
extension_dir = "C:\php\ext\"
upload_tmp_dir = "C:\php\upload" make sure that you already have folder upload in C:/PHP
upload_max_filesize = 32M
session.save_path = "C:\php\sessions" make sure that you already have folder sessions in C:/PHP

extension=php_exif.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_imap.dll
extension=php_mbstring.dll
extension=php_mime_magic.dll
extension=php_ming.dll
extension=php_msql.dll
extension=php_mssql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdf.dll
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
extension=php_pdo_odbc.dll
extension=php_pgsql.dll
extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
extension=php_zip.dll
6. Save the change of Php.ini file


PHP5 and Apache configuration
1. Open Apache configuration file (httpd.conf) in Start > All Programs > Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf configuration file, and add this code at the end of the file.

2. Add word index.php at line 239

3. Change documentroot and directory to folder that you want store your php file, e.g.

4. Save the change that you made and Restart Apache.
5. To test run your PHP, type this code in Notepad or another text editor, then save as file as info.php (you must save it using format All Files (*.*), not Text Documents(.txt)) to D:/Web/Data

6. Open the browser again, type http://localhost/info.php at the address bar.


Congratulation!!! Now you can use your computer for PHP programming.

No comments: