Installation and configuration methods for Windows Apache2211 and Php529-1

Source: Internet
Author: User
Tags mirror website
Because Pharmar uses McAfee's anti-virus software, requires all programs to be installed in program files, so these files are placed under the D:\Program files for easy management. McAfee is good at writing protection rules.
Installation and configuration of Apache
Open Apache official website http://archive.apache.org/dist/httpd/binaries/win32/or mirror website http://apache.mirror.phpchina.com/httpd/ binaries/win32/, download the Apache_2.2.11-win32-x86-no_ssl.msi installation file inside. Among them, the same version has two types: No_ssl and OPENSSL,OPENSSL more SSL security authentication mode, its protocol is HTTPS instead of HTTP, this is the server with SSL and the general Web server difference. Under normal circumstances, we download the No_ssl version of the OK.
After downloading the Apache installation file, click Install, after 3 consecutive times next, will enter the server information configuration interface, ask for the e-mail address of network domain, server domain and webmaster. Ordinary users can simply fill in the format of the line. After pressing next again, there is an interface to select the installation path, the default path is longer, Pharmar the installation path to: "D:\Program files\apache\", continue to install until completed.
Once installed, Apache will start automatically to test if Apache has successfully started. In the browser address bar, enter: http://localhost/or HTTP://127.0.0.1/, if "It works.", then congratulations, Apache has successfully installed At the same time, there is a green Apache server running icon in the taskbar in the lower right corner of the computer.
Apache also has a configuration file: Httpd:conf needs to be configured for PHP to run. Location: D:\Program files\apache\conf directory. Open httpd:conf:
1), Look for "DocumentRoot", here is the directory that specifies the home page to place. The default is: "D:\Program files\apache\htdocs", you can use the default directory, you can also define one yourself, such as: "d:/php". Note: Do not add "/" at the end of the directory.
2), find "DirectoryIndex", here is the default home page name, you can add index.php and so on after index.html. Leave a space between each type.
3), find

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all

Modified to:

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all

If you do not change this here, you may appear that you do not have permission to access/on the this server. This error message, especially after changing the path of the default home page.
Note: Each time you modify the httpd:conf file, you will have to restart the Apache server. Also, if you have an IIS server running on your Win32 system, stop the IIS server from running before you start Apache, or the Apache server will not start.
How to install and configure PHP
First download version of Windows from PHP's official website http://www.php.net/downloads.php, there are two versions: PHP 5.2.9 zip package and php 5.2.9 installer, Currently, the latest version is 5.3.0,pharmar 5.2.9 version. PHP 5.2.9 Installer for automatic installation, although relatively automated, but in many ways limited, so Pharmar is not recommended this way, the following describes the PHP 5.2.9 Zip package under the way of manual installation.
1), the PHP compression package zip extracted to a directory, recommended: "c:/php", Pharmar is D:\Program files\php.
2), the PHP directory (D:\Program files\php) under the Php.ini-dist file renamed to the php.ini,php configuration file is it, modify the following several places, modify the php.ini file to C:\WINDOWS\ In the catalogue:
Extensi, point to the path of the "Php_*.dll" file placed under the PHP folder. The paths of PHP4 and PHP5 differ here.
Doc_root= "D:\PHP", pointing to the front page position of the previous Apache settings;
Default_charset= "gb2312", modify the default character set, here, if preceded by a semicolon ";", remove the semicolon;
The Register_globals=off is changed to Register_globals=on, making the transitive global variable valid;
Extension=php_dba.dll If there is a semicolon in front, remove the semicolon to the same;
Extension=php_dbase.dll
Extension=php_gd2.dll GD library do diagram, generally used for graphic verification code;
Extension=php_mysql.dll is used to connect MySQL database;
3) Copy the Php5ts.dll file from the PHP directory to the C:\WINDOWS\system32 directory.
4), and finally modify the Apache httpd.conf file. Add the following 2 lines at the end of the file to indicate that PHP is installed as a module into Apache:
LoadModule Php5_module D:/program Files/php/php5apache2_2.dll
AddType application/x-httpd-php. php
Note: The first line of the directory path to be updated to the current version of the Apache dynamic link library, for example, I am using the apache2.2.11 version and php5.2.9, the file must be Php5apache2_2.dll, but not Php5apache.dll, Php5apache2.dll and so on. The second act is the suffix of php footsteps.
PHP4 version, you need to add a line AddType mod_php4.c, and in php5, there is no need for such a row AddType mod_php5.c, PHP5 has been integrated, or Apache can not start.
The above completes the Apache and PHP configuration process, restart Apache. In the default directory of the server "D:\Program Files\apache\htdocs" in the new file index.php, write the following code:
Phpinfo ();
?>
Enter HTTP://127.0.0.1/or http://localhost/in the browser's address bar and you will see the PHP version information. So far, PHP and Apache have been installed successfully.
Here is a detail: Apache configuration file httpd.conf in the directory partition symbol is "/", and PHP configuration file php.ini in the directory is required to be a backslash "\", do not confuse oh.
The installation of MySQL is simple. To the official website http://dev.mysql.com/downloads/mysql/5.0.html, download MySQL under Windows platform, select the latest version of Windows Zip/setup.exe (x86) is 5.0.77, You can download it. Direct installation, after the installation is complete, you can enter the configuration Wizard to set the MySQL database password. Everything OK.
About MySQL installation and configuration see: phpMyAdmin installation Configuration method and problem solving
Pharmar errors encountered during installation:
After installing PHP under Windows, Apache appeared LoadModule takes two arguments error, the main reason is httpd.conf in this sentence:
LoadModule Php5_module D:\Program Files\php\php5apache2_2.dll
The interpreter treats the space in program files as a separator of two parameters, so there is no space in the statement. On the internet for half a day and did not find a solution, and finally with a level of directory symbols to solve the problem, changed to the following:
LoadModule Php5_module. /php/php5apache2_2.dll
Because Apache is installed in the D:\Program files\apache\ directory, PHP is installed in D:\Program files\php\, so: /on the D:\Program files\ directory, this is finally done, I hope everyone in the installation and configuration of the process of multi-brain always have a way.

The above describes the installation and configuration of Windows Apache2211 and php529-1, including aspects of the content, I hope the PHP tutorial interested in a friend to help.

  • 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.