Windows 2000/xp/2003 install APACHE2.0.53, PHP5.0.3

Source: Internet
Author: User
Tags iis ini mysql php file php code win32 mysql database phpmyadmin
Apache|php5|window First Step Installation mysql4.1.10a (this article is configured for mysql4.1 and mysql5.0 versions)

Will download the MySQL compression package, extract directly to the specified directory (d:\php\mysql) on it
Then double-click D:\php\mysql\bin\winmysqladmin.exe This file, enter Winmysqladmin's initial user, password (note: This is not a user in MySQL, Password) Don't worry about it. After you make sure that your lower right corner of the task's boot bar will appear a traffic light icon (green), red light on behalf of the service stop, green light on behalf of the normal service
(if it's not a green light, just left-click the icon->winnt->install the service to install it
And then left-click this icon->winnt->start the service to start MySQL services

Modify the MySQL database root password
Start-> Run, enter CMD and then CD to D:\mysql\bin execute the following command

D:\mysql\bin>mysql

Go to MySQL and then execute:

(Set the root password to easy)


The next step is to allow PHP to connect to the above version of mysql4.1, must not be omitted. Specific reference to http://www.phpv.net/article.php/288


Please change your password according to the other


If you download the system installation package, extract to any directory after the direct double-click Setup.exe file, according to the habit of installing the software installed it, remember to the path to choose that step, please write D:\php\mysql installed after the D:\php\mysql\bin\ folder opened, Double-click the Winmysqladmin.exe file to pop up a window that asks for the username password for your MySQL service administrator. Make your own.


The difference between the two methods is clear.

Step two: Install Apache and configure support for PHP

Double-click the installation file Apache_2.0.53-win32-x86-no_ssl.msi
To install Apache in the D:\php\apache directory
There will be input boxes, prompts to enter the domain name Administrator mailbox, casually fill it out.
+-----------------------------------------------------
| NOTE: The Apache service will be installed and started automatically after installation, as a problem arises here:
| (OS 10048) typically each socket address (Protocol/network address/port) is allowed only once:
| Make_sock:could not bind to address 0.0.0.0:80 ... "Typically IIS takes up 80 ports
| Workaround: Open the Control Panel-> service to locate the IIS Admin service shutdown and disable
| Then use CMD to enter command line mode into the directory where you install Apache/apache2/bin
| Input
| Apache-k Install
| Apache-k start
| If successful, then do the following!
+--------------------------------------------------------------

Extract the contents of the Php-5.0.3-win32.zip into the D:\php\php.

Find the Php.ini-dist in the PHP directory (it seems like this is a habit, in fact I prefer to use php.ini-recommended) rename to php.ini and copy to the Windows System directory (special case: Win2K system directory for Winnt)
Like my php.ini is a copy to the C:\Windows directory
Then copy the Php5ts.dll,libmysql.dll in the PHP directory to the System directory system directory as mine is C:\Windows (also can be C:\Windows\System32) the last to D:\php\php\ext will Php_ Gd2.dll Php_mysql.dll These two files are copied to System/system32 as mine is C:\Windows\System.

Configure the httpd.conf in Apache

Open D:\php\Apache\conf\httpd.conf This file

Find Adddefaultcharset iso-8859-1 change it to

Adddefaultcharset GB2312 (Let the default language be encoded in Simplified Chinese)

Find DocumentRoot "D:/php/apache2/htdocs" to change it to your web directory, as my

DocumentRoot "D:/php/www"

Find DirectoryIndex index.html Index.html.var after adding index.htm index.php (default index.php homepage file)

--------------Modular installation of PHP----------------------------------------
Find #LoadModule Ssl_module modules/mod_ssl.so This line, add a line after this row

LoadModule Php5_module D:/php/php/php5apache2.dll

Where D:/php/php/php5apache2.dll is the location of the Php5apache2.dll in your PHP directory

And then find AddType application/x-gzip gz. tgz, join a line after this row

AddType application/x-httpd-php. php

(In fact: the above two lines of red, you can directly add to the end of the httpd.conf file can also be)
--------------------------------------------------------------------

The PHP environment is basically configured successfully at this time
In the Web root directory (such as my D:\php\www) to build a named test.php (hint: With notepad friend, please avoid file for test.php.txt), the file content as follows PHP code: Echo Phpinfo ();?> Restart Apache service
Open http://localhost/test.php in Browser
OK if you can see the PHP configuration output information
(If you are looking for a download page or an echo phpinfo (), please check to see if there are any errors or omissions)

Third, configure php.ini and test MySQL, GD2 (php.ini under C:\Windows php.ini)


Found it
; Extension=php_mysql.dll
Will '; ' Remove it instead.

Extension=php_mysql.dll find; Extension=php_gd2.dll remove the front; To support the GD library. such as Extension=php_gd2.dll

Found it
; Session.save_path = "/tmp"
Will '; ' Remove. Set the directory where you saved the session, such as

Session.save_path = "C:\WINDOWS\Temp";

Restart the Apache service
In the Web root directory (such as D:\PHP\WWW) to establish the testdb.php file contents are as follows: PHP code: <?php
$link =mysql_connect (' localhost ', ' root ', ' 123456 '); Here the root and 123456 are MySQL users and passwords, please change according to your own situation.
if (! $link) echo "fail";
else echo "Success";
Mysql_close ();
?> Open the http://localhost/testdb.php with the browser if the output is success OK

Iv. installation and configuration of phpMyAdmin

Unzip the phpmyadmin-2.6.1.zip to the Web root (d:\php\www\), rename the folder to phpMyAdmin or other
Open the config.inc.php in the phpMyAdmin directory
Find the following (I have changed the following):

$cfg [' pmaabsoluteuri '] = ' http://localhost/phpmyadmin '; Assume that there is a domain name of the server, can be changed to http://domain name/phpmyadmin


$cfg [' Servers '] [$i] [' user '] = ' root ';

$cfg [' Servers '] [$i] [' password '] = ' easy; Fill in your MySQL user and password separately

$cfg [' Servers '] [$i] [' auth_type '] = ' http '; This can also be changed to cookies.



Change the save, in the browser open Http://localhost/phpmyadmin enter your username and password, you can manage MySQL


Almost, if you want your PHP code to execute faster, install a Zend Optimizer. can be downloaded to http://down.phpv.net/soft/379.htm
The method is: After downloading, double-click, select the path to install. Ask php.ini path to fill c:/windows


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.