Manual building notes for php5 + apache + mysql5 in Windows

Source: Internet
Author: User

Here I will not talk about things that are too conceptual (I can't say it, haha), but programmers need to know the basic principles, such as the basic operating principles of websites, php running requires the php environment. java and DotNet also need their own runtime environment. The php runtime environment is php. In fact, I don't know how to say it. It is a runtime, first, prepare several jobs. We need:

1.apacheinstallation package, apache_http_server_source_httpd-2.2.17-win32-src.zip. You can download the package from the official website, http://www.apache.org/or download it from the image.

2. MySQL installation package, MySQL-essential-5.1.32-win32.msi, download location I don't say ha, we try to go to the official website to download, so as not to get back a trojan or bind malicious plug-ins.

3. php running environment: http://www.php.net/. you do not need to download the source Code. You need to download the released version. Otherwise, a bunch of. h may not be able to meet our "Senior Programmer" level.

The installation package is ready. There is no limit on the order of the three installation packages. Here, we will start from installing apache.

1. install Apache. This method is also suitable for most people. You may need to enter Server Domain, Admin Email, and other similar things in the next process. You can skip this step, but pay attention to the port selection, by default, only port 80 and port 8080 are available. After the installation is successful, you can modify the Listen port as needed. This avoids duplication with the default port 80 of IIS. You can select port 8080. If the installation is successful after next, we will not talk about it. Some pots may fail to find the Apache service in Apache Server Monitor after installation. the apache-related services cannot be found in msc. I encountered this problem and the solution was simple: Run cmd as an administrator, switch to the $ Apache2.2 $ \ bin \ httpd.exe-k install directory, and the system prompts an error, but the service still appears. You can still run it by clicking start, normally, the system prompts that the installation is successful and Testing httped is started. conf... now, the installation of apache is complete. Of course, you can test it and open httpd. conf: Modify the DocumentRoot configuration section of about 164 rows. I modified it like this: DocumentRoot "C:/". Note that if you haven't done it or are afraid that you cannot find the default httpd. conf can back up one or comment out the configuration section you want to modify. Find the <Directory node of about 194 rows and change it to <Directory "C:/">, that is, the Directory of the website you want to access, restart Apache, and enter: http: // localhost: 8080/testing.html.

2. Install MySQL. It seems that there is nothing to pay attention to when installing MySQL, that is, whether remote access is allowed. If you only perform a test, do not select it. If it is a server, consider security issues with caution.

3. install the php environment. As mentioned above, after downloading the php environment and decompressing it, create a folder named Apahe Group in the root directory of the C drive. In Apache development, version 5 is the version number of the current runtime environment, well, I copied an expert. Copy all the files in the downloaded package to the php5 folder, find the file named php. ini-production, and rename it php. ini. Open php. ini, find the short_open_tag, and change the default value "short_open_tag = Off" to "short_open_tag = On", that is, let PHP support short tag writing, such as when set to Off, <? = $ Xxx;?> An error is reported. <? Phpecho $ xxx;?> Only. Then in php. extension_dir = ". /"change this line to extension_dir =" C:/Apache Group/php5/ext ", in this way, the php runtime environment can find the location of the extension plug-in according to this directory. Be sure to delete the plug-in before the line. Find the Windows Extensions configuration module, and search

Extension = php_mbstring.dll
Extension = php_gd2.dll
Extension = php_mysql.dll

Then, run the Semicolon ";" to open the support for mysql and other processes in the php environment, so that the php program can connect to the database. Finally, find disable_functions = and change it to disable_functions =
Passthru, exec, system, popen, chroot, escapeshellcmd, escapeshellarg, shell_exec, proc_open, proc_get_status. After completion, the php runtime environment address is: C: \ Apache Group \ php5, which will be used in subsequent apache configuration.

4. Configure apache to support php. Open $ Apache2.2 $ \ conf \ httpd. conf, find the # LoadModule ssl_module modules/mod_ssl.so line, and add the following lines after it:

# Specify the location of the php. ini file

PHPIniDir "C: \ Apache Group \ php5"

# Specify the parsing module of the php Program

LoadModule php5_module "C: \ Apache Group \ php5 \ php5apache2_2.dll"

# Specify the extension of the file to be parsed

AddType application/x-httpd-php. php

# Specifying the PHP source code Extension

AddType application/x-httpd-php-source. phps

Save and exit. Now the running environment of apache + mysql + php5 is set up. You can create a new file phpinfo. php In the test directory, which is written as follows: <? Php phpinfo () ;?>, Then, access through http: // localhost: 8080/phpinfo. php. If successful, the following page appears:

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.