Install and configure csdn apache + php + mysql in windows

Source: Internet
Author: User
Tags apache php

Csdn apache + php + mysql installation and configuration in windows Start to build the environment: installed version: apache2.2.22, mysql 5.5.24, php 5.3.13 (1) During installation, you must uninstall the previously installed apache and so on. Before uninstalling apache, please be sure to stop the services of apache and mysql. After the services are stopped, we are uninstalling apache and mysql respectively. (2) There is no special thing to install apache. It is always the default. You can change the path (3) (4) network domain name, just write it as needed, such as setnet.com and server Domain Name: write localhost. If you want to write in your mailbox, You need to note that you do not need to modify it. Test whether apache is successfully installed. Open your browser and enter localhost in the address bar. If it works appears! Indicates that the installation is successful. Apache installation is complete. (5) install php (6) Because php exists as a module of apache, php is loaded through the apache configuration file. The above are the folders installed in apache, php, and mysql. decompress the compressed packages installed in php and copy all the files in the decompressed folders to the above php folders. Then httpd under conf in the apache folder. conf file, the path of the loading module Php5apache2_2.dll is the path in the current php folder, d:/myevn/php/is the path of my installation (7) Write a php file, test whether the PHP file can be output normally. Some output all the code of the file. If this problem occurs, we can try the php file again below the php module. (8) mysql (9) is always installed by default. When you encounter coudom, select this option. When you encounter a path change, remember to modify the installation path, remember to select utf8 when you want to modify the encoding. The default password is always used. For example, you cannot write a password without writing it. If you write it in a database, you must enter a password in advance to open the database ,, you can directly access the database without writing. In addition, a list will appear during installation, which is similar to the tree. Because it is inconvenient for me to install it, remember to select mysql to modify its path. Its path is D: \ mysvn \ mysql \ data is the dada in dada under the file where mysql is installed. The test is under the PHP file, mysql_connect ('localhost', 'root', ''); The quotation marks are the password. To write the password, it will be OK if there is no blank password. When the call succeeds, resource (3) of type (mysql link) is similar to the rest. (10) to this point, we have installed all of them successfully. (11) virtual directory configuration (1) browser configuration: On the system disk, my system disk is a drive C, and the hosts file of drive C: \ Windows \ System32 \ drivers \ etc under drive C: \ Windows \ System32 \ drivers \ etc, we need to modify it. Based on the Principle of domain name resolution, write 127.0.0.1 localhost 127.0.0.1 www.php.com 127.0.0.1 www.sina.com In the hosts file. This is the IP address of the specified domain name, And www.sina.com is the virtual directory (2) every website can be used as a module to divide and conquer, and modify the apache configuration file httpd. conf to # Virtual hosts # Include conf/extra/httpd-vhosts.conf remove comments and find the conf/extra/httpd-vhosts.conf file each site corresponds to a module (3) such as www.sina.com, or localhost all correspond to The configuration file httpd of pache. conf, modify httpd. conf to the <VirtualHost *: 80> ServerAdmin webmaster@dummy-host2.somenet.com DocumentRoot "D: /myenv/apache/docs/dummy-host2.somenet.com "ServerName dummy-host2.somenet.com ErrorLog" logs/dummy-host2.somenet.com-error.log "CustomLog" logs/dummy-host2.somenet.com-access.log "common </VirtualHost> Configure one by yourself, one module has at least two items, 1. Who is my domain name? 2. Where is the root directory of my website? <VirtualHost *: 80> DocumentRoot "D:/myenv/myweb/sina" ServerName www.sina.com </VirtualHost> after access, the forbbiden permission is displayed. Modify the permission: <Directory "D: /myenv/myweb/sina "> Order Deny, Allow Deny from All Allow from All </Directory> can be written in either of the following ways: (1) <VirtualHost *: 80> DocumentRoot" D: /mysvn/myweb/sina "ServerName www.sina.com <Directory" D:/mysvn/myweb/sina "> Options Indexes MultiViews order allow, deny Allow from all </Directory> </VirtualHost> (2) <VirtualHost *: 80> DocumentRoot "D:/mysvn/apache/htdocs" ServerName localhost <Directory "D: /mysvn/apache/htdocs "> Order Deny, Allow Deny from All Allow from All </Directory> </VirtualHost> (12) Configure php. INI file, allowing him to operate mysql by default, without php. ini configuration file, but provides Php. ini-development mode Php. ini-production: Modify php in the production environment. after ini, because apache will read the pp configuration file, you need to tell the apache php configuration file location first: Modify php. ini extension = php_mysql.dll before cancellation. Then: Modify httpd under apache conf. conf LoadModulephp5_module "D:/mysvn/php/php5apache2_2.dll" <FilesMatch \. php $> SetHandlerapplication/x-httpd-php </FilesMatch> PHPIniDir D:/mysvn/php, which is newly added so far. The installation of the three major giants has come to the fore.

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.