The configuration method of apache2.2.16+php5.3.3+mysql5.1.49 _linux

Source: Internet
Author: User

First step: Download the installed files
1. MySQL: Download address mysql-5.1.49-win32.msi;
2. Apache: Download address httpd-2.2.16-win32-x86-openssl-0.9.8o.msi;
3. PHP5.3.3 Download Address 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, let alone download the VC9 version, because he is the IIS Server installation version.
Step Two: Install files
1. Build a folder on the disk you want to install (the author's practice is to create a PHP folder D:\php in the root directory of D disk).
2. Install the Apache server, the completion of the installation of the directory results are: D:\php\Apache.
3. Download thePhp-5.3.3-win32-vc6-x86Unzip the D:\php directory, you can change the name of the folder to shorten the result D:\PHP\PHP5
4. Install MySQL database, it installs and the general situation is same. The author installs him in (D:\php\MySQL) and PHP in the same directory.
Step Three: Configure PHP5.3.3
1. Configure PHP5.3.3, open the PHP installation directory (the author is D:\php\php5) can see the directory has two such filesPhp.ini-development and Php.ini-production, the first is to develop the configuration file used, and the second is the configuration of the standard production environment.
2. SelectPhp.ini-developmentCopy one to the same directory and rename it toIniOpen using the Text tool to findExtension_dirOK
See two, selectOn Windows: The one below and go to the previous semicolon fix insteadExtension_dir = "D:/php/php5/ext",Reader root
According to its own directory structure configuration, the purpose is to find and php.ini the same directory in the Ext folder in the extension library.
3. Find Extension=php_, removeExtension=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.dllFront
The semicolon. Look for short_open_tag = off to modify it to Short_open_tag = on to support the short label.
4. Copy php5ts.dll file to Windows/system32 directory, only php-5.3.3-win32-vc6-x86 version of Php5ts.dll
The php-5.3.3-nts-win32-vc6-x86 version is not available.
Fourth Step: Configure Apache
1. Open the httpd.conf file in the Conf directory in the Apache directory to find the #loadmodule, which is about 128 lines at the end.
Add to:
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. FindDirectoryIndex index.html Modify it to DirectoryIndex index.php default.php index.html index.htm default.html
Default.htm
3. Find DocumentRoot Modify it to point to the folder where you need to place the Web file (the author created a d:/php directory
www folder) so DocumentRoot is documentroot "d:/php/www", readers can modify according to their own configuration.
4. Find <directory to modify it to your own configured DocumentRoot path (the author is <directory "d:/php/www" >)
Step Fifth: Test whether the PHP+APACHE+MYSQL is configured successfully
1. Open MySQL to create a new database and table in MySQL. (the author is the UserInfo database and the Users table has the ID and name two fields)
Test it? Simple is good, hehe!!
2. Create a index.php file in the WWW folder created above to open using EditPlus or other text tools.
3. Write:

Copy Code code as follows:

?
$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/carriage return in the browser.
If you see the following picture: we are done! Congratulations, 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.