Windows Php5+apache+mysql5 Hand-built notes _win server

Source: Internet
Author: User
I'm not going to say anything that's too conceptual here. haha), but the basic principle of the programmer is to know, such as the basic principle of the Web site, PHP operation requires PHP environment, Java,dotnet also need their own operating environment, then PHP's operating environment is PHP, In fact, I do not know how to say Ah, anyway is a runtime, first of all, prepare a few work, we need:

1.Apache installation package, Apache_http_server_source_httpd-2.2.17-win32-src.zip, you can go directly to the official website download, http://www.apache.org/can also be downloaded from the mirror, It's okay.

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

3.php operating Environment, http://www.php.net/, note do not download to source Code, to download the release version, or a bunch of. h is not up to the level of "senior programmers" like us.

The installation package is ready, and the order of the three packages is unrestricted, starting with the installation of Apache.

1. Apache installation. Also suitable for the majority of the way next,next process may need to fill in the server domain,admin email and other similar things, this can be skipped, but pay attention to port selection, by default is only 80 and 8080 ports available to choose from, Of course, after successful installation, you can modify the listen port at your own discretion, this place avoids duplication with IIS default 80, you can choose 8080 port. Next after the installation is successful, the situation will not be said. Some pots may have been installed and the Apache service could not be found in the Apache Server Monitor. In Services.msc can not find Apache-related services, I just encountered this problem, the solution is also very simple: Administrator identity run cmd, switch to the directory $Apache 2.2$\bin\httpd.exe-k install is almost, I made a prompt error, but still appeared in the service, click Start can still run, normally prompted to install successfully and start testing httped.conf ... At this point, the Apache installation even finished, of course, you can test, you can open httpd.conf, modify about 164 lines of DocumentRoot configuration section, I was this modified: DocumentRoot "c:/", Note that if you haven't done it, or you're afraid you won't be able to find the default httpd.conf, you can back up one or, first, annotate one of the configuration sections you want to modify. Then find about 194 rows of <directory nodes, modified to <directory "c:/", which is the directory of the site you want to visit, and then restart Apache, enter in the browser: http://localhost:8080/ Testing.html look at it.

2.MySQL of installation. Like the installation of MySQL there is no need to pay attention to it, that is, whether there is a permit remote access, if you just do the test, then do not select, if it is the server, it also carefully consider security issues.

3.php environment installation, as mentioned above, download the PHP environment after decompression, in the C-packing directory to establish a folder named Apahe Group, in the Apache group directory to establish a folder named PhP5, Because I downloaded PHP version for Php-5.3.5-win32-vc9-x86.zip, so 5 is the current operating environment version number Ah, oh, I copied an expert. Then copy all the files in the download package to the PHP5 folder, locate the file named Php.ini-production, and rename it to PHP.ini. Open php.ini, find Short_open_tag, the default is "short_open_tag= off" to "Short_open_tag =on", that is, let PHP support a short label, such as when set to off, in the writing program with <?=$ xxx;? > will make an error, write <?phpecho $xxx;? > will do. Then find the Extension_dir = "./" line in php.ini, modify it to Extension_dir = "C:/apache Group/php5/ext", This allows the PHP runtime to find the location of the extensions that it needs based on this directory, and pay attention to the split before the row is deleted. Then locate the Windows Extensions configuration module, and search below it

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

Then the preceding semicolon ";", open the PHP environment to MySQL and other processes support, so that the PHP program mining can be connected to the database operations. Finally find disable_functions =, modify it to Disable_functions =
Passthru,exec,system,popen,chroot,escapeshellcmd,escapeshellarg,shell_exec,proc_open,proc_get_status. After the completion of the PHP Runtime environment address is: C:\Apache GROUP\PHP5, this address will be used in subsequent Apache configuration.

4.apache Configuration for PHP support. Open $apache2.2$\conf\httpd.conf, find #loadmodule ssl_module modules/mod_ssl.so this line, and then add the following lines:

# Specify where php.ini files are located

Phpinidir "C:\Apache group\php5"

# Specify the parsing module for the PHP program

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

# Specifies the extension of the file to be resolved

AddType application/x-httpd-php. php

# Specify PHP source code extension

AddType Application/x-httpd-php-source. Phps

Save exit, at this time APACHE+MYSQL+PHP5 's running environment is completed, you can create a new file in the test directory phpinfo.php, which writes: <?php phpinfo (); localhost:8080/phpinfo.php for access. If successful, a page with the following image appears:

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.