Installation and configuration of Apache + php + mysql in windows

Source: Internet
Author: User
Tags php server website server
Extract right-click and decompress. Specifies the decompression location. I set it to "D: php" to view the solution.

Welcome to the Windows community forum and interact with 3 million technicians> 2. install php and use module, combining php with apache enables your website server to support php server scripting by right-clicking the downloaded php installation file php-5.0.5-Win32.zip to decompress it. Specifies the decompression location. I set it to "D: \ php" to view the solution.

Welcome to the Windows community forum and interact with 3 million technicians>

2. php installation and module-based integration of php and apache enables your website server to support php server script programs

Download the php installation filePhp-5.0.5-Win32.zipRight-click and extract.

Specifies the decompression location, which is set to "D: \ php"

View the decompressed folder and find "php. ini-dist file, rename it as "php. ini, open edit, find the place in the figure below, Ln385, there is a "register_globals = Off" value, this value is used to open global variables, such as the value sent from the form, if this value is set to "Off", you can only use "$ _ POST ['variable name'], $ _ GET ['variable name']" to obtain the sent value, if it is set to "On", you can directly use "$ variable name" to obtain the sent value. Of course, it is safer to set it to "Off, it is not easy to intercept data transmitted between webpages. If this value is changed to "On", it depends On your own feeling. Is it important for security or convenience?

There is another area to edit. The function is to enable php to directly call other modules, such as accessing mysql, as shown in Ln563. Select the module to be loaded and remove the previous ";", it indicates that the module is to be loaded. The more loaded the module, the more resources it occupies, but there is not much to load. For example, if I want to use mysql, I need to "; remove ";" before "extension = php_mysql.dll. All the module files are placed under the "ext" of the php decompression directory. Here I load all the modules that can be loaded, and the previous ";" is not removed, this module is not found in the "ext" directory by default. An error occurs when the file cannot be found during loading. This is just a reference. Generally, you do not need to load so much data. You can load the data as needed. Save the edited data and close it.

Now we can combine php with Apache in the module mode to integrate php into Apache. Open the configuration file of Apache in the previous method, Ln 173. Locate here and add the two lines in the selection, the first line is "LoadModule php5_module D:/php/php5apache2. dll is used to load php in module mode. The second line "PHPIniDir" D:/php "indicates the php configuration file. the ini location is, of course, where "D:/php" should be changed to the directory you have previously selected for php decompression.

Or Apache configuration file, Ln 757, add "AddType application/x-httpd-php. php "," AddType application/x-httpd-php. html "two lines, you can also add more, the essence is to add file types that can execute php, for example, if you add a line "AddType application/x-httpd-php .htm.pdf", the .htm file can also execute the php program. You can even add the last line "AddType application/x-httpd-php. txt, so that the common text file format can also run php programs.

The default index file of the directory mentioned above can also be changed. Because php is added, some files are saved directly. php, we can also set "index. php "is set as the default index file, which is ranked first in priority. Edited, saved, and closed.

Now, php installation and integration with Apache have all been completed. Restart Apache with a small icon in the lower right corner of the screen, and your Apache server supports php.

[1] [2] [3]

Related Article

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.