Configure Apache + PhP5 + mysql5 under windows2000adv

Source: Internet
Author: User
Tags php download

In the past, we used a kit package for convenience. the version is apache1.x. mysql4.x, php4.x. it has been outdated for a long time .. and there are a lot of vulnerabilities. Fortunately, I only use them locally... however, in order to catch up with the trend, we just need to change the gun ..

Software Version used:

Mysql-5.0.4-beta-win32

Apache_2.0.54-win32-x86-no_ssl

Php-5.0.3-Win32

PhpMyAdmin-2.6.2-rc1

ZendOptimizerWindows-i386

The above software can be downloaded from various major download websites. Or you can directly log on to the official website to download the software. There are also a lot of configuration tutorials, so I will not make detailed technical documents ..

PHP official website http://www.php.net /? With Chinese language services, you can even find the latest Chinese PHP Manual
PHP download page http://www.php.net/downloads.php

Official Apache http://www.apache.org/
Download Apache page http://archive.apache.org/dist/httpd/

MySQL, as a database software, is free of charge. Of course, it is very efficient and has similar features as PHP.
MySQL official website http://www.mysql.com/

PhpMyAdmin for Windows v2.6.2

I downloaded it from the sky software site: http://www.skycn.com/soft/10687.html.

Zendoptimizerwindows, which is used to parse some source code and optimize it. I downloaded it from the sky software site.

Zend optimizer v2.5.7 for Windows:

Is to download the sky software station: http://www.skycn.com/soft/20133.html

Install allProgramThen, start to configure .:

First configure apache2
Open the httpd. conf configuration file under the apache2conf folder.
To join
LoadFile C:/PHP/php5ts. dll // load php5ts. dll, which is a required link library for both Apache and IIS.
Loadmodule php5_module C:/PHP/php5apache2. dll // load the Apache module of PhP5
Addtype application/X-httpd-PHP. php
'Www .knowsky.com
Find DocumentRoot, followed by "C:/apache2/htdocs", which may vary depending on the installation path,
It is the location of the web page Directory and can be changed to what you need. Note that it is a slash "/" not a backslash ". After all, it is transplanted under Linux.
Check for directoryindex. the value should be index.html. var.
This is the default homepage name. You need to add index. php index.htm

Then configure PHP
Rename PHP. ini-recommended in the C: PhP folder to PhP. ini.
PHP. ini: for security and efficiency considerations, we recommend that you use PHP. ini-recommended as the blueprint for PHP. ini instead of using PHP. ini-Dist. At the same time, the search path for PHP. INI is no longer limited to % SystemRoot % in the PhP4 era. PhP5 searches for PHP. ini in the following path:

* phpinidir (Apache 2 module only)
* registry key value: hkey_local_machinesoftwarephpinifilepath
* environment variable: % phprc %
* PhP5 directory (for CLI), or Web Server Directory (for
SAPI modules)
* Windows Directory (C: Windows or C: winnt)
in these five solutions, it is best to use phpinidir in combination with apache2, followed by % phprc % environment variable, and remember to open PHP to the server on NTFS. ini.
open PHP. INI: Find extension_dir and change it to "C:/PHP/EXT". Check that folder and you will know what it is.
find Windows extensions. There is a row below; extension = PHP _***. DLL
the semicolon is removed, removed is the support component
at least remove the semicolon before
extension = php_gd2.dll
extension = php_mbstring.dll
extension = php_mysql.dll
PhP5 start default mySQL is not supported, therefore, we need to add support for it, except for removing the semicolon from extension = php_mysql.dll
There Is A libmysql in the PHP Directory. DLL file, copy it to the System32 folder of the system, and copy PHP. INI to the Windows directory

It will be online tutorials in the future... no way, lazy ..

PHP. INI is stored in c: \ winnt \ system32. PHP can be parsed. mySQL can also run normally. I started IIS. port 80 is occupied, so I chose port 8080 when installing Apache. it is not to load Apache into a service ..

However, when running phpMyAdmin, it is displayed that the MySQL extension cannot be loaded. Check the PHP configuration.

It must have been a problem connecting to MySQL. first, modify the phpMyAdmin configuration file and open config. inc. PHP, find: $ cfg ['servers'] [$ I] ['host'], fill in the local address, generally fill in localhost. the following options, such as user and password, are also configured.

Restart Apache. It's still the same. No, it seems to be PHP. there is a problem with INI. find extension = PHP _***. DLL, these are extension files, I removed the '; before most of the extensions, so that it supports more extensions .. the dead horse is a medical doctor .. haha .. restart Apache again, again disappointed ..

When I thought of dizzy headers, I couldn't think of an error there. phpinidir and % phprc % are all correct. ah. regardless of the PHP. copy the INI file to c: \ WINNT and install Apache as a service:

Run c: \ apache_php \ apache group \ apache2 \ bin \ apache.exe-K install in cmd.

Then: C: \ apache_php \ apache group \ apache2 \ bin \ apache.exe-K restart

In the pop-up dialog box with a lot of error messages, the system prompts that files such as php_bz2.dll cannot be found, and click the mouse. A miracle occurs, so you can enter the phpMyAdmin homepage...

The main problem is also solved. the next step is to clean up the PHP. extension = PHP _ *** In the INI file _***. add the ';' sign to the DLL and comment them out. There is no need for so many extensions, leaving only the necessary:

Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mysql.dll

Restart Apache again, and the system prompts that files such as php_mbstring.dll are missing. in this case, copy php_mbstring.dll and php_mysql.dll under PHP \ ext to c: \ winnt \ system32 \ and restart Apache. Everything is OK ~! The command "$ cfg ['pmaabsoluteuri']" must be set in your configuration file!

This is so easy. Find the config of phpMyAdmin. inc. PHP. This is the phpMyAdmin configuration file. find $ cfg [\ 'pmaabsoluteuri \ '] and fill in the relative path of your phpMyAdmin, for example, localhost \ phpMyAdmin. Press F5 to refresh it once, that's all right...

The above configuration took me two or three hours, and then I tried to put PHP under C: \ WINNT. copy the INI file to c: \ winnt \ system32. the following error occurs: the MySQL extension cannot be loaded. Check the PHP configuration. this error prompt... it seems that PhP5 and PhP4 are a little different.

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.