Home > Article > Backend Development > Tutorial on configuring PHP running environment on the server, php running environment_PHP tutorial
1. Enter mysql -hlocalhost -uroot -p in the DOS command window and press Enter to enter the mysql database,
Among them, -h means server name, localhost means local; -u is database user name, root is mysql default user name; -p is password, if a password is set, you can directly enter it in the link after -p,
For example: -p123456, the user has not set a password. When Enter password is displayed, just press Enter.
Note, if your mysql is not installed on the C drive, 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: to enter the D drive, enter cd D:ToolsMySQL5.5.25bin and enter the bin directory of mysql before entering mysql -hlocalhost -uroot -p
2.wampservice A method to configure multiple sites: (Use a URL-like access method)
a. Open wampbinapacheApache2.2.21confhttpd.conf, find #Include conf/extra/httpd-vhosts.conf and remove the #
b. Open the extra/httpd-vhosts.conf file; add similar content at the end: (the file path is the path of your own installation program)
DocumentRoot "D:/wamp/www/aaa" (This is the file path where you put the program)
ServerName www.aaa.com (This is a self-defined domain name)
For example:
DocumentRoot "D:/wamp/www/Discuz_X3.1_upload"
ServerName www.dz.com
c. Find the file C:WindowsSystem32driversetchosts and finally add: (If you want to change this file to deny access, you can go to the control panel, change the user account control settings, and turn off uac)
127.0.0.1 www.aaa.com (This is a self-defined domain name)
d. Save and restart the service. Enter: www.aaa.com in the browser to see the effect.
3.APMService A method to configure multiple sites: (local test environment, localhost:port number method)
a. Find the httpd.conf file under Listen 80; add a corresponding port, for example: Listen 81. ----------(about line 53)
b. At the default virtual host, change the port and corresponding folder name (i.e. path). ----------(around line 494)
c. Just restart the service.
Note: access localhost by default; newly added example: localhost:81
www/ has 3 folders; htdocs/ is where website files are placed
4. Provide a simple way to configure multi-site virtual machines in the wampservice server in the httpd.conf file
a. Add a port: listen 81
b. Configure virtual host name:
DocumentRoot "D:/wamp/www/Discuz_X3.1_upload"
ServerName localhost:81