This article mainly introduces the construction of PHP integrated operating environment (Windows XP SP3 operating system environment) PHP5.2.11 + Apache2.2.19 + MySQL5.1.45
> Install and configure Apache (install to C:\apache)
1, install the default installation, Network Domain, Server name I fill in My Computer name, Administrator ' s email address area fill your email addresses
2, after installation in the installation directory has a conf folder, open the httpd.conf file for configuration
• Find DocumentRoot, set it as the folder you want to store PHP, HTM and other Web files, such as "D:\phpapache\Apache2.2\htdocs";
• Find DirectoryIndex, add index.php, index.htm and so on after index.html, separate it with a single space;
• Restart Apache to test for success with http://localhost or http://127.0.0.1 or http://yourcompanyname. The success of the words screen will have an IT works!
> Install config PHP (unzip php tarball to C:\php)
1. Rename the php.ini-recommended file to php.ini and cut it to the directory where the system is located (for example, in 2000/nt winnt, xp Windows directory),
2, change the Extension_dir to Php/ext directory, such as "C:\php\ext";
3, the doc_root changed to the same directory in the first step, such as "C:\apache\htdocs";
4, find; Session.save_path = "/tmp", will '; ' Remove, set the directory where you saved the session, such as Session.save_path = "c:/php/tmp";
5. Then remove the semicolon in front of the following sentence to better support MySQL and PHPmyadmin
Extension=php_mbstring.dll
Extension=php_gd2.dll
Extension=php_mysql.dll
Extension=php_pdo.dll
Extension=php_pdo_mysql.dll
> Php+apache Integration
1. Allow Apache to run the PHP program as a module:
Open httpd.conf and add the following (any location):
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php. php
AddType application/x-httpd-php. htm
(. htm,. php Extensions for executable PHP languages, plus HTML, php3, PHP4, and even txt)
(The following two steps may not be required)
2. If you need to run a PHP program in CGI mode for some reason (using Php.exe),
Please turn the above line into a comment (each outfit adds #) and add the following lines:
# scriptalias/php/"c:/php/"
# AddType application/x-httpd-php. php
#Action application/x-httpd-php "/php/php-cgi.exe"
3, now Apache 2 support HTML and not support PHP, first add the following sentence to C:\apache\conf\httpd.conf:
# scriptalias/php/"c:/php/"
# AddType application/x-httpd-php. php
#Action application/x-httpd-php "/php/php-cgi.exe"
> Restart Service, test environment
1, found in the C:\php php5ts.dll,libmysql.dll copy it to C:\winnt\system32 (winnt/2000 machine), and winxp/2003 is copied to C:\windows\system32
2. Test whether Apache and PHP are connected successfully:
Start the start Apache service or restart restart Apache if it is running
3. Create a new test.php under the Web root directory (i.e. C:\apache\htdocs)
Test
Phpinfo ();
?>
4. Running http://localhost/test.php
If successful, you should see a Web page with a PHP logo that contains a number of settings and other information
So congratulations, the environment has been built successfully!
Keywords: php PHP5 Apache MySQL PHP Runtime Environment