Deploy Apache + PHP + MySQL on a 64-bit Windows 7 System (actual steps are recorded)

Source: Internet
Author: User
Tags fully qualified domain name

Reprinted: http://blog.csdn.net/zy_sun1023/article/details/8120354

 

1. Currently, No 64-bit Apache is installed. On the internet, find the 64-bit apache1.https: // Blackdot. be/download-archive/download a httpd-win64 2.2.192. no Installer. decompress the package to the desired location (my location D: \ Program Files \ apache) 3. modify the configuration file D: \ Program Files \ apache \ httpd-2.2-x64 \ conf \ httpd. conf [Note path must use the left slash]: serverroot "/httpd-2.2-x64" changed to serverroot "D:/program files/Apache/httpd-2.2-x64" Listen 80 changed to listen 8080 # port, if IIS is enabled, port 80 cannot use DocumentRoot "/httpd-2.2-x64/htdocs" to documentr Oot "D:/program files/Apache/httpd-2.2-x64/htdocs" # Place the path of the website file directoryindex index.html to directoryindex index.html index.htm index. PHP # add index. PHP, PHP's inventory page ScriptAlias/cgi-bin/"/httpd-2.2-x64/cgi-bin/" changed to ScriptAlias/cgi-bin/"D: /program files/Apache/httpd-2.2-x64/cgi-bin/"<directory"/httpd-2.2-x64/htdocs "> changed to <directory" D: /program files/Apache/httpd-2.2-x64/htdocs "> <directory"/httpd-2.2-x64/C Change Gi-bin to <directory "D: /program files/Apache/httpd-2.2-x64/cgi-bin "> remove the # Before loadmodule rewrite_module modules/mod_rewrite.so and include/_ httpd/test. delete the conf line (if not, ignore it) and add servername 192 to the comment of servername. 168. *. * (IP address corresponding to localhost): 8080 otherwise, an error will be reported when the command is executed later. (Error: cocould not reliably determine the server's fully qualified domain name ). 4. Start installation, run cmd as administrator, enter D: \ Program Files \ apache \ httpd-2.2-x64 \ bin
Run the command: httpd.exe-K install (add Apache to the system service, the default service name is apache2.2) run the command: httpd.exe-K start (run the service) 5. test whether the installation is successful. Enter http: // localhost: 8080 in the browser. If it works is displayed! The installation is successful. If it cannot be displayed, an error is returned. The following error message is displayed: <OS 5> access is denied when the command: httpd.exe-K install is executed. : Failed to open the WINNT Service Manager solution: the software is installed in conflict with Windows 7's "User Account Control" (UAC, you only need to close the UAC (Control Panel-User Account and home security-system and security-Action Center, which contains "Change User Account Control Settings" and change it to never notice, after the installation is complete, you will be prompted to restart the system. At this time, you need to restart the system. After the installation is complete, you can change it back. 2. phpphp installation does not have the official 64-bit version, so it also downloads the edited version. 1. http://p.gokuai.com/index.php? M?index&a=file&file=1378gslw4gf7777pdownload php-5.2.5-x64-2007-11-12.zip. 2. after decompression, copy all the content in the php-5.2.5 (x64) folder to a path, my path is D: \ php3. modify Apache configuration file D: \ Program Files \ apache \ httpd-2.2-x64 \ conf \ httpd. conf
Add the following to the line # loadmodule vhost_alias_module modules/mod_vhost_alias.so:
Loadmodule php5_module "D:/PHP/php5apache2_2.dll" # Load Apache module
Phpinidir "D:/PHP" # This is the path of PHP
Add the following content to addtype application/X-gzip. GZ. tgz:
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. html #. html,. php can be an extension of the executable PHP language

Note: X-httpd-PHP. PHP and X-httpd-PHP. html ". "There is a space in front. 4. copy the following file to D: \ Program Files \ PHP \ php5ts under C: \ windows \ system32. DLL
D: \ Program Files \ PHP \ php5isapi. dll
D: \ Program Files \ PHP \ php5apache2_2.dll
D: \ Program Files \ PHP \ ext \ php_mysql.dll
D: \ Program Files \ PHP \ ext \ php_mysqli.dll
D: \ Program Files \ PHP \ libmysql. dll5. change D: \ Program Files \ PHP. ini-Dist to PhP. ini and make the following modifications.
Modify extension_dir = "./"
Extension_dir = "D: \ Program Files \ PHP \ Ext" # specify the directory of the dynamic Connection Library
Load the DLL by removing the semicolon (comment.
Extension = php_gd2.dll
Extension = php_mysql.dll
Extension = php_oci8.dll (Oracle database)
Extension = php_pgsql.dll (postgre database)
Extension = php_zip.dll

Modify the session settings. save_path = "/tmp" is session. save_path = "D:/PHP/custom/session" Configure PHP's Temporary Folder path modification; upload_tmp_dir = "D: /PHP/custom/upload "short_open_tag = on this option select whether to enable the abbreviated label: Yes <? ?>, This place should be renamed on6. test whether the installation is successful in D: \ Program Files \ apache \ httpd-2.2-x64 \ htdocs file, new to index. php file, the file content is only: <? PHP phpinfo ();?>
Restart Apache: Enter the D: \ Program Files \ apache \ httpd-2.2-x64 \ binfile in cmd and execute the command: httpd-K shutdown (close Apache) httpd-K restart (restart Apache ). Open http: // localhost: 8080. If the PHP configuration is displayed, the installation is successful. If not, the error is returned.

Iii. Install MySQL Note: Some Articles mentioned that MySQL is configured in D: \ Program Files \ PHP. ini. MySQL. default_port = 3306
MySQL. default_host = localhost1.http: // logs, (my location is D: \ Program Files \ mysql server 5.5 \). If you do not enter the Configuration Wizard, click Finish. 3. Enter the D: \ Program Files \ mysql server 5.5 \ binfile, right-click bin, and run mysqlinstanceconfig as an administrator. Change the number of connections to 1000. Set the administrator root password. Do not check the box below the password input box. Someone on the Internet mentioned that applying security settings is not successful. Successful! 4. test whether the database is successfully installed. Start-all programs-mysql runs mysql5.5 command line cilent. Enter the administrator root password. You want to view the databases that come with the MySQL database using commands (command Terminator; or \ G) show databases; create a new database: createdatabase database name; for example: Create Database test1; 5. test whether to connect to MySQL in D: \ Program Files \ apache \ httpd-2.2-x64 \ htdocs new link. PHP: Enter <? PHP $ link = mysql_connect ("127.0.0.1", "root", "password entered during MySQL installation"); If (! $ Link) echo "MySQL database connection failed !"; Else echo "MySQL database connection successful !"; Mysql_close ();?> Open the browser and enter http: // localhost: 8080/link. php to view

 

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.