First download APACHE2.2.3 Mysql 5.0.22 PHP 5.2.0 from the website
Assumption: The system disk is c:/
Assumption: After installation, the directory status will be like this:
apache-------------------------> C:Program FilesApache Software FoundationApache2.2
mysql--------------------------->C:Program FilesMySQLMySQL Server 5.0
php-----------------------------> c:/php
Preparation:
Before installation, you need to check whether port 80 and port 3306 are occupied by other programs. If so, you need to delete the corresponding software.
The first step is to install mysql.
Unzip the compressed package and execute the installation file. Most of them just need to be installed according to the default path and installation prompts. It should be noted that anonymous users cannot be selected, and the path to mysql needs to be added to the system Path. After the installation is complete, you need to restart your computer.
After restarting the computer, check [Control Panel] à [Administrative Tools] à [Services] to determine whether the mysql service is started. If not, start the mysql service.
Note: The mysql login terminal in the shortcut is directly logged in as the root user, and the password prompted is the password of the root user. You can create user databases and new users in this root user state. The command is as follows:
CREATE DATABASE gc0100; //Create database
GRANT ALL PRIVILEGES ON gc0100.* to gc0100@localhost IDENTIFIED BY 'gc0100';//Create local user
GRANT ALL PRIVILEGES ON gc0100.* to gc0100@"% " IDENTIFIED BY 'gc0100';//Create a remote user and then enter cmd in [Start]->[Run]
Then execute the command:
Databases accessed by mysql –u username –p will then prompt for the corresponding user’s password.
Step 2: Install apache and configure it to support PHP.
Double-click the installation file apache_2.2.3-win32-x86-no_ssl.msi and install it according to the default path and prompts. By default, it will be installed under C:Program FilesApache Software FoundationApache2.2.
There will also be an input box that prompts you to enter the domain name and administrator's email address. Just fill it in casually.
+------------------------------------------------- ----
| Note: After the installation is completed, the apache service will be automatically installed and started. If a problem occurs here:
|" (OS 10048) Normally only one use of each socket address (protocol/network address/port) is allowed:
| make_sock: could not bind to address 0.0.0.0:80..." This is usually caused by IIS occupying port 80.
| Solution: Open Control Panel->Services, find the IIS admin service, close and disable it
| Then use CMD to enter the command line mode and enter the directory where you installed apache/apache2/bin
| +------------------------------------------------ ---------------
To start Apache, you only need to start it in the shortcut function of Apache.
Then test whether apache is successful in IE and enter http://localhost
If It works! appears, it means that apache is installed successfully.
To install PHP, unzip the contents of php-5.2.0-Win32.zip to c:php
and find php.ini-dist in the php directory (it seems this is a habit, in fact, I prefer to use php.ini-recommended) Rename it to php.ini and copy it to the windows system directory (special case: win2k system directory is c:winnt, windows xp is c:windows directory
Then copy all the dynamic libraries (*.dll) in the php directory to the system32 directory (c:winntsystem32 for win2k, c:windowssystem32 for windows xp)
Finally, go to c:phpext and copy the two files php_gd2.dll php_mysql.dll to the system32 directory (same as above)
Configure httpd.conf in apache
and use notepad to open the C:Program FilesApache Software FoundationApache2.2confhttpd.conf file
Find AddDefaultCharset ISO-8859-1 and change it to
AddDefaultCharset GB2312 (make the default language encoding Simplified Chinese)
Find DocumentRoot "C:Program FilesApache Software FoundationApache2.2htdocs" and change it to your WEB directory,
For example: DocumentRoot "D:/www"
finds DirectoryIndex index.html index.html.var and then adds index.htm index.php (default index.php is the home page file)
------------- -Modular installation of PHP----------------------------------------
Find the line #LoadModule ssl_module modules/mod_ssl.so and add a line after this line
LoadModule php5_module c:/php/php5apache2.dll (**Error**)
Modify to: LoadModule php5_module “c:/php/php5apache2_2.dll”
Reason: php5apache2.dll only supports version 2.0 of apache and cannot support versions 2.2 and above because our latest version of apache is 2.2.3
Therefore, the new version of the dynamic library php5apache2_2.dll must be used, and the old version of the dynamic library cannot be used. But if the apache you installed is version 2.0, you only need to use the old version of the dynamic library, that is, php5apache2.dll
Among them, c:/php/php5apache2.dll(php5apache2_2.dll) is the location of php5apache2.dll(php5apache2_2.dll) in your php directory.
Then find the AddType application/x-gzip .gz .tgz line and add it after this line. One line
AddType application/x-httpd-php .php
(Actually: the two red lines above, you can add them directly at the end of the httpd.conf file)
-------------------------------------------------- ------------------
At this point, the PHP environment has basically been configured successfully. Create a file named test.php (for example, my D:phpwww) in the WEB root directory (such as my D:phpwww) Tip: For those who use Notepad, please avoid the file (test.php.txt), the content of the file is as follows
PHP code:
<? echo phpinfo(); ?>
Restart the apache service and open http://localhost/test.php with a browser
If you can see the php configuration output information, it will be OK.
(If you see the download page or <? echo phpinfo(); ?>, please check whether there are any errors or omissions between what you have done and the above)
3. Configure php.ini and test mysql and GD2 (php.ini is php.ini under c:windows)
.
;extension=php_mysql.dll
Remove ';' and change it to
.extension=php_mysql.dll
turn up
;extension=php_gd2.dll Remove the previous; to support the GD library. For example
extension=php_gd2.dll
found
;session.save_path = "/tmp"
Remove the ';'. Set the directory where you save the session, such as
session.save_path = "C:WINDOWSTemp";(windows xp)
session.save_path = "C:winntTemp";(windows 2000)
Restart the apache service and create the testdb.php file in the Web root directory (such as D:phpwww) with the following content:
PHP code:
<?php
$link=mysql_connect('localhost','root','123456'); //The root and 123456 here are the MYSQL user and password. Please change them according to your own situation.
if(!$link) echo "fail";
else echo "success";
mysql_close();
?>
Open http://localhost/testdb.php with a browser and it will be OK if the output success is
4. Installation configuration of phpmyadmin:
Unzip phpMyAdmin-2.6.1.zip to the WEB root directory (d:phpwww), Rename the folder to phpmyadmin or otherwise open config.inc.php in the phpmyadmin directory
Find the following (I have changed the following):
$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin'; //Assuming it is a server with a domain name, it can be changed to http://domain name/phpmyadmin
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'easy; //Fill in your mysql users respectively Just add the password
$cfg['Servers'][$i]['auth_type'] = 'http'; // You can also change it to cookie here
and save it. Open http://localhost/phpmyadmin in the browser and enter With your username and password, you can manage mysql
. If you want your PHP code to execute faster, install Zend Optimizer.
download method can be found at http://down.phpv.net/soft/379.htm
: double-click after downloading and select the path to install. When asked about the PHP.INI path, fill in c:/windows.
Install and restart the apache service. Look at http: //localhost/test.php You should see more things
with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies
with Zend Optimizer v2.5.7, Copyright (c) 1998-2004, by Zend Technologies