Tutorial _ PHP instance for configuring the php runtime environment on the server

Source: Internet
Author: User
This article mainly introduces how to configure the PHP runtime environment on the server and related configurations. It is very comprehensive and is recommended for you here. 1. Enter mysql-hlocalhost-uroot-p in the doscommand window to enter the mysql database,

-H indicates the server name, localhost indicates local,-u indicates the database user name, root indicates the mysql Default User Name, and-p indicates the password. If the password is set, you can directly enter the link after-p,
For example,-p123456. If the user does not set a password, press Enter to display the Enter password.
NOTE: If your mysql is not installed on drive C, you need to first use the DOS command to enter the bin directory under the mysql installation directory.

Take my computer as an example. The method is as follows:
Enter D: Enter disk D. Enter cd D: \ Tools \ MySQL5.5.25 \ bin to enter the bin directory of mysql before entering mysql-hlocalhost-uroot-p.

2. wampservice: (use a URL-like access method)

A. Open wamp \ bin \ apache \ Apache2.2.21 \ conf \ httpd. conf, find # Include conf/extra/httpd-vhosts.conf to remove #
B. Open the extra/httpd-vhosts.conf file; add similar content at the end: (the file path is the path of your own installer)
DocumentRoot "D:/wamp/www/aaa" (this is the file path of your program)
ServerName www.aaa.com (this is your own defined domain name)

For example:
DocumentRoot "D:/wamp/www/discuz_x3.20.upload"
ServerName www.dz.com

C. find the file C: \ Windows \ System32 \ drivers \ etc \ hosts and add it to the end: (if you change this file to deny access, you can go to the control panel, change the User Account Control settings, and disable uac)
127.0.0.1 www.aaa.com (this is your own defined domain name)

D. Save and restart the service. Enter www.aaa.com in the browser to view the effect.

3. APMService is a method for configuring multiple sites: (local test environment, localhost: port number)

A. Find the httpd. conf file Listen 80 and add a corresponding port, for example, Listen 81. ----------- (About 53 rows)

B. Change the port and the corresponding folder name (PATH) at the default VM ). ------------ (About 494 rows)

C. Restart the service.

Note: Access localhost by default; new example: localhost: 81

Www/has three folders. htdocs/contains

4. A simple multi-site virtual machine configuration method is provided for the wampservice server in the httpd. conf file.

A. Add a port: listen 81
B. Configure the Virtual Host Name:

DocumentRoot "D:/wamp/www/discuz_x3.20.upload"
ServerName localhost: 81

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.