Configure php5.3.3 + apache2.2.16 + mysql5.1.49

Source: Internet
Author: User

Turn: http://zyw090111.javaeye.com/blog/731651

 

Step 1: Download the installed file
1. MySQL: mysql-5.1.49-win32.msi;
2. Apache: httpd-2.2.16-win32-x86-openssl-0.9.8o.msi;
3. php5.3.3 php-5.3.3-Win32-VC6-x86 note: Be sure to download the php-5.3.3-Win32-VC6-x86 version
, Do not download the php-5.3.3-nts-Win32-VC6-x86 version, do not download vc9 version, because he is the IIS Server Installation version.
Step 2: Install the file
1. Create a folder on the disk to be installed (the author created a PHP folder D: \ PHP under the root directory of drive D ).
2. Install the Apache server. The directory after installation is D: \ PHP \ apache.
3. download Php-5.3.3-Win32-VC6-x86 In the decompressed D: \ PHP Directory, You can shorten the folder name. The result is D: \ PHP \ PhP5.
4. Install the MySQL database. The installation is the same as normal. I installed it in the same directory as (D: \ PHP \ mysql) and PHP.
Step 3: Configure php5.3.3
1. Configure php5.3.3 and open the PHP installation directory (The author is D: \ PHP \ PhP5). Two such files are displayed in the directory. PHP. ini-Development and PHP. ini-Production The first is the development configuration file, and the second is the configuration of the standard production environment.
2. Select PHP. ini-development Copy a copy to the same directory and rename it PHP. ini Use a text tool to open and search Extension_dir , Yes
Select On Windows : Modify the following semicolon Extension_dir = "D:/PHP/PhP5/EXT ", Reader Root
According to your own directory structure configuration, the purpose is to find the extension library in the ext folder in the same directory as PHP. ini.
3. Search for extension = PHP _ and remove it. Extension = php_curl.dll, extension = php_gd2.dll, extension = php_mbstring.dll,
Extension = php_mysql.dll, extension = php_mysqli.dll, extension = php_pdo_mysql.dll, extension = php_xmlrpc.dll Front
. Search for short_open_tag = off and change it to short_open_tag = on to support short tags.
4. Copy the php5ts. dll file to the Windows/system32 directory, only the php-5.3.3-Win32-VC6-x86 version has php5ts. dll
The php-5.3.3-nts-Win32-VC6-x86 version is not available.

5. How can I not connect to MySQL and copy libmysql. dll of PHP to C:/Windows/system32.
Step 4: Configure Apache
1. Open the httpd. conf file in the conf directory under the Apache directory and search for # loadmodule. At the end of the file, there are about 128 lines.
Add:
Loadmodule php5_module "D:/PHP/PhP5/php5apache2_2.dll"
Phpinidir "D:/PHP/PhP5"
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. htm
Addtype application/X-httpd-PHP. html
The directory structure is configured according to the user's own directory.
2. Search Directoryindex index.html Modify itDirectoryindex index. php default. php index.html index.htm default.html
Default.htm
3. Search DocumentRoot Modify it to point to the folder where you want to place web files (the author created
WWW folder) So DocumentRoot Yes DocumentRoot "D:/PHP/www ", You can modify the settings as needed.
4. Search <Directory Modify it to your own configuration Documentroo T path (The author is <Directory "D:/PHP/www">)
Step 5: test whether the configuration of PHP + Apache + MySQL is successful
1. Open MySQL and create a new database and table in MySQL. (The userinfo database and users table have the ID and name fields)
Test? It's easy, huh, huh !!
2. Create an index. php file in the WWW folder created above and use editplus or another text tool to open it.
3. Write:

PHP Code
  1. <?
  2. $ Db_host="Localhost";
  3. $ Db_user="Root";
  4. $ Db_pass="Root";
  5. $ Db_name="Userinfo";
  6. Mysql_connect ($ Db_host,$ Db_user,$ Db_pass);
  7. Mysql_select_db ($ Db_name);
  8. Mysql_query ("Set names gb2312");
  9. $ SQL="Select * from users";
  10. $ Result= Mysql_query ($ SQL);
  11. While($ Data= Mysql_fetch_array ($ Result)){
  12. Echo "------------------------";
  13. Echo $ Data['Id']."<Br/>";
  14. Echo $ Data['Name']."<Br/>";
  15. }
  16. Mysql_close ();
  17. ?>
<? $ Db_host = "localhost"; $ db_user = "root"; $ db_pass = "root"; $ db_name = "userinfo"; mysql_connect ($ db_host, $ db_user, $ db_pass ); mysql_select_db ($ db_name); mysql_query ("set names gb2312"); $ SQL = "select * from users"; $ result = mysql_query ($ SQL ); while ($ DATA = mysql_fetch_array ($ result) {echo "----------------------"; echo $ data ['id']. "<br/>"; echo $ data ['name']. "<br/>" ;}mysql_close () ;?>

4. Start the Apache server and enter http: // localhost/enter in the browser.
If we see: we are done! Congratulations!

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.