Home > php教程 > php手册 > body text

WAMP server settings

WBOY
Release: 2016-10-09 08:31:46
Original
1235 people have browsed it

Server settings

  • Set in wamp/bin/apache/Apache###/conf/httpd.conf file

Root folder

  1. Modify documentroot and directory
  2. Restart the service after saving

404 return value

  1. Modify the value after errordocument and delete the #
  2. in front
  3. Restart the service after saving

Change port

  1. Modify or add listen
  2. Restart the service after saving
  • Pay attention to the format, otherwise you won’t be able to restart

Set up external access

1. Change to the following content (two parts)

<code class="hljs"><span class="hljs-tag"><Directory "E:/wamp/bin/apache/apache2.4.9/cgi-bin">
    <span class="hljs-keyword">AllowOverride None
    <span class="hljs-keyword"><span class="hljs-common">Options None
    <span class="hljs-keyword">Require <span class="hljs-literal">all granted
<span class="hljs-tag"></Directory>


<span class="hljs-comment">#   onlineoffline tag - don't remove
    <span class="hljs-keyword">Require <span class="hljs-literal">all granted
	<span class="hljs-keyword"><span class="hljs-common">allow from <span class="hljs-literal">all
	
<span class="hljs-tag"></Directory></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
Copy after login

Set localhost default display page

1. Change the following content

<code class="hljs"><IfModule dir_module>
    DirectoryIndex index<span class="hljs-class">.php index<span class="hljs-class">.php3 index<span class="hljs-class">.html index<span class="hljs-class">.htm
</IfModule><br></span></span></span></span></code>
Copy after login

2. If the page contained above is not in the localhost folder, entering localhost in the address bar will display the files in the localhost folder

Cancel errors such as undefined php functions

  • Set in php.ini
<code class="hljs"><span class="hljs-attribute">error_reporting =<span class="hljs-string"> E_ALL & ~E_NOTICE</span></span></code>
Copy after login
  • Among them
    • &: and
    • ~: Not
  • Attention
    • For other error types, you can ask Du Niang and use logical judgment to make a choice as needed

Modify MySQL default encoding format

  • Add in my.ini
  • [mysql]Add configuration default-character-set=utf8
  • [mysqld]Add configuration character_set_server=utf8

Modify post upload file size

  • Set it in php.ini, search for the post and find it yourself...

Modify server time

date.timezone = prc (China time zone) in the php.ini file

Create a second site

  • Open C:wampbinapacheapache2.4.9confhttpd.conf
    • Remove the comment "Include conf/extra/httpd-vhosts.conf"
    • Remove the comment "LoadModule rewrite_module modules/mod_rewrite.so"
<code class="hljs"><span class="hljs-keyword">httpd.conf文件修改,
<span class="hljs-keyword">AllowOverride <span class="hljs-literal">all
 <span class="hljs-keyword">Require <span class="hljs-literal">all granted
 <span class="hljs-keyword"><span class="hljs-common">allow from <span class="hljs-literal">all</span></span></span></span></span></span></span></span></code>
Copy after login
  • Open C:wampbinapacheapache2.4.9confextrahttpd-vhosts.conf and add
<code class="hljs"><span class="hljs-tag"><VirtualHost *:80>
    <span class="hljs-keyword"><span class="hljs-common">ServerName blog
    <span class="hljs-keyword"><span class="hljs-common">DocumentRoot <span class="hljs-string">"E:/blog"
    <span class="hljs-tag"><Directory "E:/blog">
    <span class="hljs-keyword"><span class="hljs-common">Options Indexes FollowSymLinks
    <span class="hljs-keyword">AllowOverride <span class="hljs-literal">all
    <span class="hljs-keyword"><span class="hljs-common">Order Allow,Deny
    <span class="hljs-keyword"><span class="hljs-common">Allow from <span class="hljs-literal">all
    <span class="hljs-tag"></Directory>
<span class="hljs-tag"></VirtualHost></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code>
Copy after login
  • hosts file added
<code class="hljs">文件位置:<span class="hljs-tag">C:\<span class="hljs-tag">Windows\<span class="hljs-tag">System32\<span class="hljs-tag">drivers\<span class="hljs-tag">etc
127<span class="hljs-class">.0<span class="hljs-class">.0<span class="hljs-class">.1      blog</span></span></span></span></span></span></span></span></code>
Copy after login

- NOTE:

1. Options Indexes FollowSymLinks If not, disable Apache from displaying the directory structure. The user will not see the list of files and subdirectories in this directory.
2. When entering the second site for the first time, you need to put http:// in front of the address (I don’t know why)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template