The first thing to say is the relationship between Apache (server), PHP (development language), and MySQL (database).
Apache: Web services support for the system, website: http://www.apache.org/
PHP: PHP support for the system to enable Apache to run PHP programs, website: http://www.php.net/
Mysql: Database system for storing various alarm events, website: http://www.mysql.com/
1, Apache is the Server Foundation, PHP and MySQL need him to coordinate the work;
2, PHP is a script interpretation, if not PHP, then the Apache out of the thing is just static, can not be implemented in the server function;
3, MySQL is a database, completely can be used alone, but with the other two, it is the PHP code called the MySQL interface, and Apache is responsible for explaining the PHP code, so that he can really implement the call to MySQL.
If there is any music that can make people quiet, I must hear the eardrum breaking!
———— remember.
Apache version: Httpd-2.2.17-win32-x86-no_ssl.msi (the apache2.2 has been successfully installed in the previous log, installation path: C:\Apache2.2)
PHP Version: Php-5.2.6-win32.zip
Add Apache support for PHP:
1) Unzip Php-5.2.6-win32.zip to c:\php
2) Copy the Php5ts.dll file to C:\Windows\System32 (that is,%SystemRoot%\System32, if the Windows 2000 operating system
The C:\WINNT\system32 directory)
Php5ts.dll is a Apache supported in the server PHP The necessary documents to be placed in the System32 directory.
when this dynamic link library is missing Apache does not start properly. .
3) Change the contents of c:\php under Php.ini-dist and save the file name to PHP.ini, then copy to C:\Windows (ie%systemroot%)
PHP.ini does not need to be copied to the Windows directory (or can be copied to the Windows directory), as long as httpd.conf is specified as follows: Phpinidir "c:\php"
Extension=php_gd2.dll
Extension=php_mysql.dll
If PHP.ini has the sentence, ";" in front of this statement The comment is removed. Uncomment, let PHP support MySQL database and call the GD library.
Copy c:\php\extension under Php_gd2.dll and Php_mysql.dll to C:\Windows (i.e.%systemroot%)
Modify Extension_dir specified path in php.ini
This should be: Extension_dir = C:/php/ext (set according to the directory name in the PHP installation path).
4) Add in C:\apache2.2\conf\httpd.conf:
LoadModule php5_module "C:/php/php5apache2_2.dll"
Apache version before 2.2 with LoadModule Php5_module "C:/php5/php5apache2.dll is OK.
Apache version above 2.2 write LoadModule Php5_module "C:/php5/php5apache2_2.dll", otherwise cannot restart.
AddType application line below add the following two lines of information
AddType application/x-httpd-php. php. phtml. php3. PhP4
AddType Application/x-httpd-php-source. Phps
5) New test.php,test.php file content in apache2.2 htdocs directory :<? phpinfo ();? >
Use http://localhost:50080/test.php in your browser to test if PHP is installed successfully, as shown in the success:
if the download test.php situation occurs during the connection process, it should be AddType application/x-httpd-php. php. phtml. php3 php4; AddType application/ X-httpd-php-source. Phps settings Error, review the changes to the format can be resolved, or in httpd.conf DirectoryIndex index.html after the index.php.
Win7 system, apache2.2 add PHP5 configuration Detailed