How to install PHP, MySQL and Apache in Windows?

Written by Admin. Posted in Computer - System

php,mysql,apache,server,linux server,phpmyadmin,apache server,install server

For new programmer, I hope this guide can quite help your work.

 

A. Download

Download PHP (non-msi installer!!), MySQL (msi installer), MySQL Tools, Apache (msi installer), Phpmyadmin and FileZilla Server

B. APACHE

  1. Create sub directory and install Apache in sub-directory like "C:/Web" (Type localhost as server name, then test using http://localhost in web browser).
    If you're not sure, go to My Computer, choose Manage, click > Services and Applications > Services to see whether the server work.
  2. Modify "C:\Web\conf\httpd.conf":
    DocumentRoot 'C:/Web/htdocs'
    DirectoryIndex index.php index.html
  3. Add these code at end of the file:
  4. #Enable PHP processing
    LoadModule php5_module "c:/Web/php/php5apache2_2.dll"
    #.php files should be processed as PHP
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    AddHandler application/x-httpd-php .php

    #Where to find php.ini
    PHPiniDir "C:/Web/php"
  5. Open it up and find the line that says: extension_dir = "./"
    and change it to extension_dir = "C:\Web\php\ext"

    Find the line that says: ;session.save_path = "/tmp"
    and change it to session.save_path = "C:\WINDOWS\temp"

  6. Restart Apache server to take effect.

C. PHP

  1. Unzip PHP in directory "C:/Web".
  2. Right click on "My Computer", then choose "Property". Click on the "Environment Variables" then click "Path" and "Edit". Go to the end of that line and add ";C:\Web\php;", then click OK. Restart your computer so that this change will take effect.
  3. Modify "C:\Web\php\php.ini":
    extension_dir = "C:/Web/php/ext"
    Uncomment, extension=php_curl.dll
    Uncomment, extension=php_mcrypt.dll
    Uncomment, extension=php_mysql.dll
    Uncomment, extension=php_mysqli.dll
  4. Restart your Apache server.
  5. Create phpinfo.php file contain:
    <?php
    phpinfo();
    ?>
  6. Upload phpinfo.php to "C:/Web/htdocs".

D. MySQL

  1. Install MySQL server and MySQL Tools by default.
  2. Download Phpmyadmin and unzip to "C:/Web/htdocs".
  3. Modify "config.inc.php":
    $cfg['blowfish_secret'] = '1234567890'; // change to random string of your choice
  4. Create at least one user in MySQL Tools for 5.0/MySQL Administrator.
  5. If you're not sure, go to My Computer, choose Manage, click > Services and Applications > Services to see whether the MySQL server work.

E. FTP server

  1. Download FileZilla Server and install by default.
  2. Create at least one user, by click Edit > Users. Enable the account, password and tweak other settings.

F. Install Ioncube and Zend Optimizer

G. Install PEAR

Download PEAR Package, extract and replace PEAR folder in PHP package with your PEAR package.

H. Done

That's it! go to "http://localhost/phpinfo.php" to test your server.

 

***Other Useful Tips

Modify php.ini ini your server to get best performance:

max_execution_time = 600 ; Maximum execution time of each script, in seconds
max_input_time = 300 ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M ; Maximum amount of memory a script may consume (32MB)
error_reporting = E_WARNING & ~E_NOTICE
log_errors = Off
upload_max_filesize = 100M


Related ArticlesLatest Articles