Configure Apache 2.0 + PhP5 + mysql5 in Windows

Source: Internet
Author: User

There are still many solutions to this problem on the network, but most of them require Copy Some files Windows Or System32 The directory is not elegant enough. I have referenced PHP User Manual and MySQL To find a solution that does not need to copy files.
The preparation steps are as follows:

1. Set PH P 5.1.4 Decompress the package D: \ PHP , Copy PHP. ini-recommended Is PHP. ini

2. Install Apache 2.0.59

3. Install Mysql5

4. Backup" Apache Group \ apache2 \ conf "Folder

5. Slave MySQL Download website MySQL connector/PHP File, download MySQL extension (pH P 5.1.4 ) For MySQL Server 5.0.22 The package.

 

The following describes how to configure.

Modify Apache Of Httpd. conf File

1. Add phpinidir variable; set loading PhP5 module path; set . php file type processing method. The Code is as follows:

# PHP config

Loadmodule php5_module "D:/PHP/php5apache2. dll"

Addtype application/X-httpd-PHP. php

Phpinidir "D:/PHP /"

2.Set Index. php Join Directoryindex Variable. The Code is as follows:

Directoryindex index.html. var index. php

Update MySQL connector/PHP

Extract MySQL connector/PHP Compressed package D: \ PHP , And Php_mysql.dll Copy D: \ PHP \ ext

Modify PHP. ini

1.Modify Include_path = ".; D: \ PHP \ Pear"

2. modify extension_dir =" D: \ PHP \ Ext "

3. cancel extension = php_mysql.dll semicolon

4.Cancel Extension = php_gd2.dll Semicolon

 

The configuration is completed here. To test the effect, you can Apache Group \ apache2 \ htdocs Create a folder named Phpinfo. php File, the content is as follows:

<? PHP

$ Link = mysql_connect ('localhost', 'test', 'test ');// User and password , Please change it based on your own situation

If (! $ Link) echo "fail ";

Else echo "success ";

Mysql_close ();

Echo phpinfo ();

?>

 

then access HTTP: // localhost/phpinfo. php If the top of the page is printed success , the setting is successful. Otherwise, you can use phpinfo check the problem.

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.