亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Inhaltsverzeichnis
Apache和PHP的版本分別為:
Apache配置:
打開conf\httpd.conf文件,修改如下:
修改ServerName:
修改Directory:
注釋掉這個Directory:
加入默認頁文件命名:
開啟虛擬主機:
打開conf\extra\httpd-vhosts.conf文件:
PHP配置:
打開php的解壓目錄,將php.ini-Deployment重命名為:php.ini
修改extension_dir為:
修改extension:
修改date.timezone:
將apache設置為windows service方法:
文章參考:
Heim php教程 php手冊 [PHP] - Apache + PHP 環(huán)境搭建

[PHP] - Apache + PHP 環(huán)境搭建

Jul 11, 2016 pm 08:00 PM
apache php Code Open Source Umweltkonstruktion Programmierung Programmiersprache Softwareentwicklung

Apache和PHP的版本分別為:

  • httpd-2.4.9-win64-VC11.zip
  • php-5.6.9-Win32-VC11-x64.zip

下載地址:

php-5.6.9-Win32-VC11-x64

http://windows.php.net/downloads/releases/php-5.6.9-Win32-VC11-x64.zip

httpd-2.4.9-win64-VC11.zip

http://dldx.csdn.net/fd.php?i=615771039219219&s=de822f7950620fad9343c3728e04b1b6

?

本機使用提win7 64位(基本上現(xiàn)在的操作系統(tǒng)都是64位的了),同時,apache和php的編譯器必需是一致。

比如我上面的版本均是VC11。如果一個使用VC9一個是VC11,運行會出錯。這點要注意。

  • 將Apache解壓到:D:\Program Files\php5.6.9
  • 將php解壓到:D:\Program Files\php5.6.9

?


?

Apache配置:

打開conf\httpd.conf文件,修改如下:

將所有:c:/apache24替換為:D:/Program Files/Apache24

?

前面加入:

LoadModule php5_module <span style="color: #800000;">"</span><span style="color: #800000;">D:/Program Files/php5.6.9/php5apache2_4.dll</span><span style="color: #800000;">"</span><span style="color: #000000;">
PHPIniDir </span><span style="color: #800000;">"</span><span style="color: #800000;">D:/Program Files/php5.6.9</span><span style="color: #800000;">"</span><span style="color: #000000;">
AddType application</span>/x-httpd-php .php .html .htm

修改ServerName:

ServerName <span style="color: #800080;">127.0</span>.<span style="color: #800080;">0.1</span>:<span style="color: #800080;">80</span>

修改Directory:

<directory></directory><span style="color: #000000;">
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</span>

注釋掉這個Directory:

#<directory style="color: #800000;">"<span style="color: #800000;">D:/Program Files/Apache24/htdocs</span><span style="color: #800000;">"</span>><span style="color: #000000;">
    #
    # Possible values </span><span style="color: #0000ff;">for</span> the Options directive are <span style="color: #800000;">"</span><span style="color: #800000;">None</span><span style="color: #800000;">"</span>, <span style="color: #800000;">"</span><span style="color: #800000;">All</span><span style="color: #800000;">"</span><span style="color: #000000;">,
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that </span><span style="color: #800000;">"</span><span style="color: #800000;">MultiViews</span><span style="color: #800000;">"</span> must be named *explicitly* --- <span style="color: #800000;">"</span><span style="color: #800000;">Options All</span><span style="color: #800000;">"</span><span style="color: #000000;">
    # doesn</span><span style="color: #800000;">'</span><span style="color: #800000;">t give it to you.</span>
<span style="color: #000000;">    #
    # The Options directive is both complicated and important.  Please see
    # http:</span><span style="color: #008000;">//</span><span style="color: #008000;">httpd.apache.org/docs/2.4/mod/core.html#options</span>
    # <span style="color: #0000ff;">for</span> <span style="color: #0000ff;">more</span><span style="color: #000000;"> information.
    #
    #Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed </span><span style="color: #0000ff;">in</span><span style="color: #000000;"> .htaccess files.
    # It can be </span><span style="color: #800000;">"</span><span style="color: #800000;">All</span><span style="color: #800000;">"</span>, <span style="color: #800000;">"</span><span style="color: #800000;">None</span><span style="color: #800000;">"</span><span style="color: #000000;">, or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    #AllowOverride None

    #
    # Controls </span><span style="color: #0000ff;">who</span><span style="color: #000000;"> can get stuff from this server.
    #
    #Require all granted
#</span></directory>

加入默認頁文件命名:

<ifmodule dir_module><span style="color: #000000;">
    DirectoryIndex index.html index.htm index.php
</span></ifmodule>

開啟虛擬主機:

Include conf/extra/httpd-vhosts.conf

?

httpd.conf文件所有配置:

<span style="color: #008000;">#
#</span><span style="color: #008000;"> This is the main Apache HTTP server configuration file.  It contains the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> configuration directives that give the server its instructions.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> See <http:></http:> for detailed information.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> In particular, see </span><span style="color: #008000;">
#</span><span style="color: #008000;"> <http:></http:></span><span style="color: #008000;">
#</span><span style="color: #008000;"> for a discussion of each configuration directive.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Do NOT simply read the instructions in here without understanding</span><span style="color: #008000;">
#</span><span style="color: #008000;"> what they do.  They're here only as hints or reminders.  If you are unsure</span><span style="color: #008000;">
#</span><span style="color: #008000;"> consult the online docs. You have been warned.  </span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Configuration and logfile names: If the filenames you specify for many</span><span style="color: #008000;">
#</span><span style="color: #008000;"> of the server's control files begin with "/" (or "drive:/" for Win32), the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> server will use that explicit path.  If the filenames do *not* begin</span><span style="color: #008000;">
#</span><span style="color: #008000;"> with "/", the value of ServerRoot is prepended -- so "logs/access_log"</span><span style="color: #008000;">
#</span><span style="color: #008000;"> with ServerRoot set to "/usr/local/apache2" will be interpreted by the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" </span><span style="color: #008000;">
#</span><span style="color: #008000;"> will be interpreted as '/logs/access_log'.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> NOTE: Where filenames are specified, you must use forward slashes</span><span style="color: #008000;">
#</span><span style="color: #008000;"> instead of backslashes (e.g., "c:/apache" instead of "c:\apache").</span><span style="color: #008000;">
#</span><span style="color: #008000;"> If a drive letter is omitted, the drive on which httpd.exe is located</span><span style="color: #008000;">
#</span><span style="color: #008000;"> will be used by default.  It is recommended that you always supply</span><span style="color: #008000;">
#</span><span style="color: #008000;"> an explicit drive letter in absolute paths to avoid confusion.</span>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> ServerRoot: The top of the directory tree under which the server's</span><span style="color: #008000;">
#</span><span style="color: #008000;"> configuration, error, and log files are kept.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Do not add a slash at the end of the directory path.  If you point</span><span style="color: #008000;">
#</span><span style="color: #008000;"> ServerRoot at a non-local disk, be sure to specify a local disk on the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> Mutex directive, if file-based mutexes are used.  If you wish to share the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> same ServerRoot for multiple httpd daemons, you will need to change at</span><span style="color: #008000;">
#</span><span style="color: #008000;"> least PidFile.</span><span style="color: #008000;">
#
</span>ServerRoot "D:/Program Files/Apache24"

<span style="color: #008000;">#
#</span><span style="color: #008000;"> Mutex: Allows you to set the mutex mechanism and mutex file directory</span><span style="color: #008000;">
#</span><span style="color: #008000;"> for individual mutexes, or change the global defaults</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Uncomment and change the directory if mutexes are file-based and the default</span><span style="color: #008000;">
#</span><span style="color: #008000;"> mutex file directory is not on a local disk or is not appropriate for some</span><span style="color: #008000;">
#</span><span style="color: #008000;"> other reason.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Mutex default:logs</span>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> Listen: Allows you to bind Apache to specific IP addresses and/or</span><span style="color: #008000;">
#</span><span style="color: #008000;"> ports, instead of the default. See also the <virtualhost></virtualhost></span><span style="color: #008000;">
#</span><span style="color: #008000;"> directive.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Change this to Listen on specific IP addresses as shown below to </span><span style="color: #008000;">
#</span><span style="color: #008000;"> prevent Apache from glomming onto all bound IP addresses.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;">Listen 12.34.56.78:80</span>
Listen 80

<span style="color: #008000;">#
#</span><span style="color: #008000;"> Dynamic Shared Object (DSO) Support</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> To be able to use the functionality of a module which was built as a DSO you</span><span style="color: #008000;">
#</span><span style="color: #008000;"> have to place corresponding `LoadModule' lines at this location so the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> directives contained in it are actually available _before_ they are used.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> Statically compiled modules (those listed by `httpd -l') do not need</span><span style="color: #008000;">
#</span><span style="color: #008000;"> to be loaded here.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Example:</span><span style="color: #008000;">
#</span><span style="color: #008000;"> LoadModule foo_module modules/mod_foo.so</span><span style="color: #008000;">
#
</span>LoadModule access_compat_module modules/mod_access_compat.<span style="color: #000000;">so
LoadModule actions_module modules</span>/mod_actions.<span style="color: #000000;">so
LoadModule alias_module modules</span>/mod_alias.<span style="color: #000000;">so
LoadModule allowmethods_module modules</span>/mod_allowmethods.<span style="color: #000000;">so
LoadModule asis_module modules</span>/mod_asis.<span style="color: #000000;">so
LoadModule auth_basic_module modules</span>/mod_auth_basic.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule auth_digest_module modules/mod_auth_digest.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule auth_form_module modules/mod_auth_form.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule authn_anon_module modules/mod_authn_anon.so</span>
LoadModule authn_core_module modules/mod_authn_core.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule authn_dbd_module modules/mod_authn_dbd.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule authn_dbm_module modules/mod_authn_dbm.so</span>
LoadModule authn_file_module modules/mod_authn_file.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule authn_socache_module modules/mod_authn_socache.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule authnz_ldap_module modules/mod_authnz_ldap.so</span>
LoadModule authz_core_module modules/mod_authz_core.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule authz_dbd_module modules/mod_authz_dbd.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule authz_dbm_module modules/mod_authz_dbm.so</span>
LoadModule authz_groupfile_module modules/mod_authz_groupfile.<span style="color: #000000;">so
LoadModule authz_host_module modules</span>/mod_authz_host.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule authz_owner_module modules/mod_authz_owner.so</span>
LoadModule authz_user_module modules/mod_authz_user.<span style="color: #000000;">so
LoadModule autoindex_module modules</span>/mod_autoindex.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule buffer_module modules/mod_buffer.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule cache_module modules/mod_cache.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule cache_disk_module modules/mod_cache_disk.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule cache_socache_module modules/mod_cache_socache.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule cern_meta_module modules/mod_cern_meta.so</span>
LoadModule cgi_module modules/mod_cgi.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule charset_lite_module modules/mod_charset_lite.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule data_module modules/mod_data.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule dav_module modules/mod_dav.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule dav_fs_module modules/mod_dav_fs.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule dav_lock_module modules/mod_dav_lock.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule dbd_module modules/mod_dbd.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule deflate_module modules/mod_deflate.so</span>
LoadModule dir_module modules/mod_dir.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule dumpio_module modules/mod_dumpio.so</span>
LoadModule env_module modules/mod_env.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule expires_module modules/mod_expires.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule ext_filter_module modules/mod_ext_filter.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule file_cache_module modules/mod_file_cache.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule filter_module modules/mod_filter.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule headers_module modules/mod_headers.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule heartbeat_module modules/mod_heartbeat.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule heartmonitor_module modules/mod_heartmonitor.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule ident_module modules/mod_ident.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule imagemap_module modules/mod_imagemap.so</span>
LoadModule include_module modules/mod_include.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule info_module modules/mod_info.so</span>
LoadModule isapi_module modules/mod_isapi.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule ldap_module modules/mod_ldap.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule logio_module modules/mod_logio.so</span>
LoadModule log_config_module modules/mod_log_config.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule log_debug_module modules/mod_log_debug.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule log_forensic_module modules/mod_log_forensic.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule lua_module modules/mod_lua.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule macro_module modules/mod_macro.so</span>
LoadModule mime_module modules/mod_mime.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule mime_magic_module modules/mod_mime_magic.so</span>
LoadModule negotiation_module modules/mod_negotiation.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule proxy_module modules/mod_proxy.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_ajp_module modules/mod_proxy_ajp.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_balancer_module modules/mod_proxy_balancer.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_connect_module modules/mod_proxy_connect.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_express_module modules/mod_proxy_express.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_ftp_module modules/mod_proxy_ftp.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_html_module modules/mod_proxy_html.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_http_module modules/mod_proxy_http.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_scgi_module modules/mod_proxy_scgi.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule ratelimit_module modules/mod_ratelimit.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule reflector_module modules/mod_reflector.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule remoteip_module modules/mod_remoteip.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule request_module modules/mod_request.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule reqtimeout_module modules/mod_reqtimeout.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule rewrite_module modules/mod_rewrite.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule sed_module modules/mod_sed.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule session_module modules/mod_session.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule session_cookie_module modules/mod_session_cookie.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule session_crypto_module modules/mod_session_crypto.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule session_dbd_module modules/mod_session_dbd.so</span>
LoadModule setenvif_module modules/mod_setenvif.<span style="color: #000000;">so
</span><span style="color: #008000;">#</span><span style="color: #008000;">LoadModule slotmem_plain_module modules/mod_slotmem_plain.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule slotmem_shm_module modules/mod_slotmem_shm.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule socache_dbm_module modules/mod_socache_dbm.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule socache_memcache_module modules/mod_socache_memcache.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule socache_shmcb_module modules/mod_socache_shmcb.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule speling_module modules/mod_speling.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule ssl_module modules/mod_ssl.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule status_module modules/mod_status.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule substitute_module modules/mod_substitute.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule unique_id_module modules/mod_unique_id.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule userdir_module modules/mod_userdir.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule usertrack_module modules/mod_usertrack.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule version_module modules/mod_version.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule vhost_alias_module modules/mod_vhost_alias.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule watchdog_module modules/mod_watchdog.so</span><span style="color: #008000;">
#</span><span style="color: #008000;">LoadModule xml2enc_module modules/mod_xml2enc.so</span>
<span style="color: #000000;">
LoadModule php5_module </span>"D:/Program Files/php5.6.9/php5apache2_4.dll"<span style="color: #000000;">
PHPIniDir </span>"D:/Program Files/php5.6.9"<span style="color: #000000;">
AddType application</span>/x-httpd-php .php .html .<span style="color: #000000;">htm

</span><ifmodule unixd_module>
<span style="color: #008000;">#
#</span><span style="color: #008000;"> If you wish httpd to run as a different user or group, you must run</span><span style="color: #008000;">
#</span><span style="color: #008000;"> httpd as root initially and it will switch.  </span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> User/Group: The name (or #number) of the user/group to run httpd as.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> It is usually good practice to create a dedicated user and group for</span><span style="color: #008000;">
#</span><span style="color: #008000;"> running httpd, as with most system services.</span><span style="color: #008000;">
#
</span><span style="color: #000000;">User daemon
Group daemon

</span></ifmodule>

<span style="color: #008000;">#</span><span style="color: #008000;"> 'Main' server configuration</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> The directives in this section set up the values used by the 'main'</span><span style="color: #008000;">
#</span><span style="color: #008000;"> server, which responds to any requests that aren't handled by a</span><span style="color: #008000;">
#</span><span style="color: #008000;"> <virtualhost> definition.  These values also provide defaults for</virtualhost></span><span style="color: #008000;">
#</span><span style="color: #008000;"> any <virtualhost> containers you may define later in the file.</virtualhost></span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> All of these directives may appear inside <virtualhost> containers,</virtualhost></span><span style="color: #008000;">
#</span><span style="color: #008000;"> in which case these default settings will be overridden for the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> virtual host being defined.</span><span style="color: #008000;">
#
</span>
<span style="color: #008000;">#
#</span><span style="color: #008000;"> ServerAdmin: Your address, where problems with the server should be</span><span style="color: #008000;">
#</span><span style="color: #008000;"> e-mailed.  This address appears on some server-generated pages, such</span><span style="color: #008000;">
#</span><span style="color: #008000;"> as error documents.  e.g. admin@your-domain.com</span><span style="color: #008000;">
#
</span>ServerAdmin admin@example.<span style="color: #000000;">com

</span><span style="color: #008000;">#
#</span><span style="color: #008000;"> ServerName gives the name and port that the server uses to identify itself.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> This can often be determined automatically, but we recommend you specify</span><span style="color: #008000;">
#</span><span style="color: #008000;"> it explicitly to prevent problems during startup.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> If your host doesn't have a registered DNS name, enter its IP address here.</span><span style="color: #008000;">
#
</span>ServerName 127.0.0.1:80

<span style="color: #008000;">#
#</span><span style="color: #008000;"> Deny access to the entirety of your server's filesystem. You must</span><span style="color: #008000;">
#</span><span style="color: #008000;"> explicitly permit access to web content directories in other </span><span style="color: #008000;">
#</span><span style="color: #008000;"> <directory> blocks below.</directory></span><span style="color: #008000;">
#
</span><directory></directory><span style="color: #000000;">
    Options FollowSymLinks
    AllowOverride None
    Order deny</span>,<span style="color: #000000;">allow
    Deny from all
</span>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> Note that from this point forward you must specifically allow</span><span style="color: #008000;">
#</span><span style="color: #008000;"> particular features to be enabled - so if something's not working as</span><span style="color: #008000;">
#</span><span style="color: #008000;"> you might expect, make sure that you have specifically enabled it</span><span style="color: #008000;">
#</span><span style="color: #008000;"> below.</span><span style="color: #008000;">
#
</span>
<span style="color: #008000;">#
#</span><span style="color: #008000;"> DocumentRoot: The directory out of which you will serve your</span><span style="color: #008000;">
#</span><span style="color: #008000;"> documents. By default, all requests are taken from this directory, but</span><span style="color: #008000;">
#</span><span style="color: #008000;"> symbolic links and aliases may be used to point to other locations.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;">DocumentRoot "D:/Program Files/Apache24/htdocs"</span><span style="color: #008000;">
#</span><span style="color: #008000;"><directory files></directory></span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> Possible values for the Options directive are "None", "All",</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> or any combination of:</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> Note that "MultiViews" must be named *explicitly* --- "Options All"</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> doesn't give it to you.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> The Options directive is both complicated and important.  Please see</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> http://httpd.apache.org/docs/2.4/mod/core.html#options</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> for more information.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">Options Indexes FollowSymLinks</span>

    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> AllowOverride controls what directives may be placed in .htaccess files.</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> It can be "All", "None", or any combination of the keywords:</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">   AllowOverride FileInfo AuthConfig Limit</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">AllowOverride None</span>

    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> Controls who can get stuff from this server.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">Require all granted</span><span style="color: #008000;">
#</span><span style="color: #008000;"></span>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> DirectoryIndex: sets the file that Apache will serve if a directory</span><span style="color: #008000;">
#</span><span style="color: #008000;"> is requested.</span><span style="color: #008000;">
#
</span><ifmodule dir_module><span style="color: #000000;">
    DirectoryIndex index</span>.html index.htm index.<span style="color: #000000;">php
</span></ifmodule>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> The following lines prevent .htaccess and .htpasswd files from being </span><span style="color: #008000;">
#</span><span style="color: #008000;"> viewed by Web clients. </span><span style="color: #008000;">
#
</span><files>
    <span style="color: #0000ff;">Require</span><span style="color: #000000;"> all denied
</span></files>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> ErrorLog: The location of the error log file.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> If you do not specify an ErrorLog directive within a <virtualhost></virtualhost></span><span style="color: #008000;">
#</span><span style="color: #008000;"> container, error messages relating to that virtual host will be</span><span style="color: #008000;">
#</span><span style="color: #008000;"> logged here.  If you *do* define an error logfile for a <virtualhost></virtualhost></span><span style="color: #008000;">
#</span><span style="color: #008000;"> container, that host's errors will be logged there and not here.</span><span style="color: #008000;">
#
</span>ErrorLog "logs/error.log"

<span style="color: #008000;">#
#</span><span style="color: #008000;"> LogLevel: Control the number of messages logged to the error_log.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> Possible values include: debug, info, notice, warn, error, crit,</span><span style="color: #008000;">
#</span><span style="color: #008000;"> alert, emerg.</span><span style="color: #008000;">
#
</span><span style="color: #000000;">LogLevel warn

</span><ifmodule log_config_module>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> The following directives define some format nicknames for use with</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> a CustomLog directive (see below).</span>
    <span style="color: #008000;">#
</span>    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""<span style="color: #000000;"> combined
    LogFormat </span>"%h %l %u %t \"%r\" %>s %b"<span style="color: #000000;"> common

    </span><ifmodule logio_module>
      <span style="color: #008000;">#</span><span style="color: #008000;"> You need to enable mod_logio.c to use %I and %O</span>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O"<span style="color: #000000;"> combinedio
    </span></ifmodule>

    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> The location and format of the access logfile (Common Logfile Format).</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> If you do not define any access logfiles within a <virtualhost></virtualhost></span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> container, they will be logged here.  Contrariwise, if you *do*</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> define per-<virtualhost> access logfiles, transactions will be</virtualhost></span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> logged therein and *not* in this file.</span>
    <span style="color: #008000;">#
</span>    CustomLog "logs/access.log"<span style="color: #000000;"> common

    </span><span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> If you prefer a logfile with access, agent, and referer information</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> (Combined Logfile Format) you can use the following directive.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">CustomLog "logs/access.log" combined</span>
</ifmodule>

<ifmodule alias_module>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> Redirect: Allows you to tell clients about documents that used to </span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> exist in your server's namespace, but do not anymore. The client </span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> will make a new request for the document at its new location.</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> Example:</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> Redirect permanent /foo http://www.example.com/bar</span>

    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> Alias: Maps web paths into filesystem paths and is used to</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> access content that does not live under the DocumentRoot.</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> Example:</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> Alias /webpath /full/filesystem/path</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> If you include a trailing / on /webpath then the server will</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> require it to be present in the URL.  You will also likely</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> need to provide a <directory> section to allow access to</directory></span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> the filesystem path.</span>

    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> ScriptAlias: This controls which directories contain server scripts. </span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> ScriptAliases are essentially the same as Aliases, except that</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> documents in the target directory are treated as applications and</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> run by the server when requested rather than as documents sent to the</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> client.  The same rules about trailing "/" apply to ScriptAlias</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> directives as to Alias.</span>
    <span style="color: #008000;">#
</span>    ScriptAlias /cgi-bin/ "D:/Program Files/Apache24/cgi-bin/"

</ifmodule>

<ifmodule cgid_module>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> ScriptSock: On threaded servers, designate the path to the UNIX</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> socket used to communicate with the CGI daemon of mod_cgid.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">Scriptsock cgisock</span>
</ifmodule>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> "D:/Program Files/Apache24/cgi-bin" should be changed to whatever your ScriptAliased</span><span style="color: #008000;">
#</span><span style="color: #008000;"> CGI directory exists, if you have that configured.</span><span style="color: #008000;">
#
</span><directory files><span style="color: #000000;">
    AllowOverride None
    Options None
    </span><span style="color: #0000ff;">Require</span><span style="color: #000000;"> all granted
</span></directory>

<ifmodule mime_module>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> TypesConfig points to the file containing the list of mappings from</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> filename extension to MIME-type.</span>
    <span style="color: #008000;">#
</span>    TypesConfig conf/mime.<span style="color: #000000;">types

    </span><span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> AddType allows you to add to or override the MIME configuration</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> file specified in TypesConfig for specific file types.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">AddType application/x-gzip .tgz</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> AddEncoding allows you to have certain browsers uncompress</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> information on the fly. Note: Not all browsers support this.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">AddEncoding x-compress .Z</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">AddEncoding x-gzip .gz .tgz</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> If the AddEncoding directives above are commented-out, then you</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> probably should define those extensions to indicate media types:</span>
    <span style="color: #008000;">#
</span>    AddType application/x-compress .<span style="color: #000000;">Z
    AddType application</span>/x-gzip .gz .<span style="color: #000000;">tgz

    </span><span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> AddHandler allows you to map certain file extensions to "handlers":</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> actions unrelated to filetype. These can be either built into the server</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> or added with the Action directive (see below)</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> To use CGI scripts outside of ScriptAliased directories:</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> (You will also need to add "ExecCGI" to the "Options" directive.)</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">AddHandler cgi-script .cgi</span>

    <span style="color: #008000;">#</span><span style="color: #008000;"> For type maps (negotiated resources):</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">AddHandler type-map var</span>

    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> Filters allow you to process content before it is sent to the client.</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;"> To parse .shtml files for server-side includes (SSI):</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> (You will also need to add "Includes" to the "Options" directive.)</span>
    <span style="color: #008000;">#
</span>    <span style="color: #008000;">#</span><span style="color: #008000;">AddType text/html .shtml</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">AddOutputFilter INCLUDES .shtml</span>
</ifmodule>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> The mod_mime_magic module allows the server to use various hints from the</span><span style="color: #008000;">
#</span><span style="color: #008000;"> contents of the file itself to determine its type.  The MIMEMagicFile</span><span style="color: #008000;">
#</span><span style="color: #008000;"> directive tells the module where the hint definitions are located.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;">MIMEMagicFile conf/magic</span>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> Customizable error responses come in three flavors:</span><span style="color: #008000;">
#</span><span style="color: #008000;"> 1) plain text 2) local redirects 3) external redirects</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Some examples:</span><span style="color: #008000;">
#</span><span style="color: #008000;">ErrorDocument 500 "The server made a boo boo."</span><span style="color: #008000;">
#</span><span style="color: #008000;">ErrorDocument 404 /missing.html</span><span style="color: #008000;">
#</span><span style="color: #008000;">ErrorDocument 404 "/cgi-bin/missing_handler.pl"</span><span style="color: #008000;">
#</span><span style="color: #008000;">ErrorDocument 402 http://www.example.com/subscription_info.html</span><span style="color: #008000;">
#
</span>
<span style="color: #008000;">#
#</span><span style="color: #008000;"> MaxRanges: Maximum number of Ranges in a request before</span><span style="color: #008000;">
#</span><span style="color: #008000;"> returning the entire resource, or one of the special</span><span style="color: #008000;">
#</span><span style="color: #008000;"> values 'default', 'none' or 'unlimited'.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> Default setting is to accept 200 Ranges.</span><span style="color: #008000;">
#</span><span style="color: #008000;">MaxRanges unlimited</span>

<span style="color: #008000;">#
#</span><span style="color: #008000;"> EnableMMAP and EnableSendfile: On systems that support it, </span><span style="color: #008000;">
#</span><span style="color: #008000;"> memory-mapping or the sendfile syscall may be used to deliver</span><span style="color: #008000;">
#</span><span style="color: #008000;"> files.  This usually improves server performance, but must</span><span style="color: #008000;">
#</span><span style="color: #008000;"> be turned off when serving from networked-mounted </span><span style="color: #008000;">
#</span><span style="color: #008000;"> filesystems or if support for these functions is otherwise</span><span style="color: #008000;">
#</span><span style="color: #008000;"> broken on your system.</span><span style="color: #008000;">
#</span><span style="color: #008000;"> Defaults: EnableMMAP On, EnableSendfile Off</span><span style="color: #008000;">
#
#</span><span style="color: #008000;">EnableMMAP off</span><span style="color: #008000;">
#</span><span style="color: #008000;">EnableSendfile on</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Supplemental configuration</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> The configuration files in the conf/extra/ directory can be </span><span style="color: #008000;">
#</span><span style="color: #008000;"> included to add extra features or to modify the default configuration of </span><span style="color: #008000;">
#</span><span style="color: #008000;"> the server, or you may simply copy their contents here and change as </span><span style="color: #008000;">
#</span><span style="color: #008000;"> necessary.</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Server-pool management (MPM specific)</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-mpm.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Multi-language error messages</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-multilang-errordoc.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Fancy directory listings</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-autoindex.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Language settings</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-languages.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> User home directories</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-userdir.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Real-time info on requests and configuration</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-info.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Virtual hosts</span>
<span style="color: #0000ff;">Include</span> conf/extra/httpd-vhosts.<span style="color: #000000;">conf

</span><span style="color: #008000;">#</span><span style="color: #008000;"> Local access to the Apache HTTP Server Manual</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-manual.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Distributed authoring and versioning (WebDAV)</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-dav.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Various default settings</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-default.conf</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> Configure mod_proxy_html to understand HTML4/XHTML1</span>
<ifmodule proxy_html_module>
<span style="color: #0000ff;">Include</span> conf/extra/proxy-html.<span style="color: #000000;">conf
</span></ifmodule>

<span style="color: #008000;">#</span><span style="color: #008000;"> Secure (SSL/TLS) connections</span><span style="color: #008000;">
#</span><span style="color: #008000;">Include conf/extra/httpd-ssl.conf</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Note: The following must must be present to support</span><span style="color: #008000;">
#</span><span style="color: #008000;">       starting without SSL on platforms with no /dev/random equivalent</span><span style="color: #008000;">
#</span><span style="color: #008000;">       but a statically compiled-in mod_ssl.</span><span style="color: #008000;">
#
</span><ifmodule ssl_module><span style="color: #000000;">
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</span></ifmodule>
<span style="color: #008000;">#
#</span><span style="color: #008000;"> uncomment out the below to deal with user agents that deliberately</span><span style="color: #008000;">
#</span><span style="color: #008000;"> violate open standards by misusing DNT (DNT *must* be a specific</span><span style="color: #008000;">
#</span><span style="color: #008000;"> end-user choice)</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"><ifmodule setenvif_module></ifmodule></span><span style="color: #008000;">
#</span><span style="color: #008000;">BrowserMatch "MSIE 10.0;" bad_DNT</span><span style="color: #008000;">
#</span><span style="color: #008000;"></span><span style="color: #008000;">
#</span><span style="color: #008000;"><ifmodule headers_module></ifmodule></span><span style="color: #008000;">
#</span><span style="color: #008000;">RequestHeader unset DNT env=bad_DNT</span><span style="color: #008000;">
#</span><span style="color: #008000;"></span>

?

打開conf\extra\httpd-vhosts.conf文件:

修改為:

?

<span style="color: #008000;">#</span><span style="color: #008000;"> Virtual Hosts</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Required modules: mod_log_config</span>

<span style="color: #008000;">#</span><span style="color: #008000;"> If you want to maintain multiple domains/hostnames on your</span><span style="color: #008000;">
#</span><span style="color: #008000;"> machine you can setup VirtualHost containers for them. Most configurations</span><span style="color: #008000;">
#</span><span style="color: #008000;"> use only name-based virtual hosts so the server doesn't need to worry about</span><span style="color: #008000;">
#</span><span style="color: #008000;"> IP addresses. This is indicated by the asterisks in the directives below.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> Please see the documentation at </span><span style="color: #008000;">
#</span><span style="color: #008000;"> <http:></http:></span><span style="color: #008000;">
#</span><span style="color: #008000;"> for further details before you try to setup virtual hosts.</span><span style="color: #008000;">
#
#</span><span style="color: #008000;"> You may use the command line option '-S' to verify your virtual host</span><span style="color: #008000;">
#</span><span style="color: #008000;"> configuration.</span>

<virtualhost><span style="color: #000000;">
    ServerAdmin admin@example</span>.<span style="color: #000000;">com
    </span><span style="color: #008000;">#</span><span style="color: #008000;"> 虛擬主機路徑</span>
    DocumentRoot "F:/PhpProject"
    <span style="color: #008000;">#</span><span style="color: #008000;"> 虛擬主機域名或IP</span>
    ServerName 127.0.0.1
    <span style="color: #008000;">#</span><span style="color: #008000;"> 虛擬主機域名或IP(別名或第二個域名)</span>
<span style="color: #000000;">    ServerAlias localhost
    </span><span style="color: #008000;">#</span><span style="color: #008000;"> 錯誤日志</span>
    ErrorLog "logs/dummy-host.localhost-error.log"<span style="color: #000000;">
    CustomLog </span>"logs/dummy-host.localhost-access.log"<span style="color: #000000;"> combined
    </span><span style="color: #008000;">#</span><span style="color: #008000;">------------------------------------------------------------------</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> 主目錄配置權限</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">------------------------------------------------------------------</span>
    <directory></directory>
        <span style="color: #008000;">#</span><span style="color: #008000;"> 列出目錄資源</span>
<span style="color: #000000;">        Options Indexes FollowSymLinks
        </span><span style="color: #008000;">#</span><span style="color: #008000;"> 禁止列出目錄資源</span>
        <span style="color: #008000;">#</span><span style="color: #008000;">Options FollowSymLinks</span>
<span style="color: #000000;">        AllowOverride All
        Order allow</span>,<span style="color: #000000;">deny
        Allow from all
    </span>
    
    <span style="color: #008000;">#</span><span style="color: #008000;">------------------------------------------------------------------</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> 虛擬目錄配置</span>
    <span style="color: #008000;">#</span><span style="color: #008000;"> 以下別名配置意思是配置一個:http://localhost/p 的虛擬目錄</span>
    <span style="color: #008000;">#</span><span style="color: #008000;">------------------------------------------------------------------</span>
    Alias /p "F:/PhpProject/ZendHello"
    <directory>
        <span style="color: #008000;">#</span><span style="color: #008000;"> 列出目錄資源</span>
<span style="color: #000000;">        Options Indexes FollowSymLinks
        </span><span style="color: #008000;">#</span><span style="color: #008000;"> 禁止列出目錄資源</span>
        <span style="color: #008000;">#</span><span style="color: #008000;">Options FollowSymLinks</span>
<span style="color: #000000;">        AllowOverride All
        Order allow</span>,<span style="color: #000000;">deny
        Allow from all
    </span></directory>
</virtualhost>

其中,DocumentRoot是php源碼的目錄。


?

?

PHP配置:

打開php的解壓目錄,將php.ini-Deployment重命名為:php.ini

修改extension_dir為:

extension_dir = "D:/Program Files/php5.6.9/ext"

修改extension:

extension=php_bz2.<span style="color: #000000;">dll
extension</span>=php_curl.<span style="color: #000000;">dll
extension</span>=php_fileinfo.<span style="color: #000000;">dll
extension</span>=php_gd2.<span style="color: #000000;">dll
extension</span>=php_gettext.<span style="color: #000000;">dll
extension</span>=php_gmp.<span style="color: #000000;">dll
extension</span>=php_intl.<span style="color: #000000;">dll
extension</span>=php_imap.<span style="color: #000000;">dll
;extension</span>=php_interbase.<span style="color: #000000;">dll
extension</span>=php_ldap.<span style="color: #000000;">dll
extension</span>=php_mbstring.<span style="color: #000000;">dll
extension</span>=php_exif.dll      ; Must be after mbstring <span style="color: #0000ff;">as</span><span style="color: #000000;"> it depends on it
extension</span>=php_mysql.<span style="color: #000000;">dll
extension</span>=php_mysqli.<span style="color: #000000;">dll
;extension</span>=php_oci8_12c.dll  ; <span style="color: #0000ff;">Use</span><span style="color: #000000;"> with Oracle Database 12c Instant Client
extension</span>=php_openssl.<span style="color: #000000;">dll
;extension</span>=php_pdo_firebird.<span style="color: #000000;">dll
extension</span>=php_pdo_mysql.<span style="color: #000000;">dll
;extension</span>=php_pdo_oci.<span style="color: #000000;">dll
extension</span>=php_pdo_odbc.<span style="color: #000000;">dll
extension</span>=php_pdo_pgsql.<span style="color: #000000;">dll
;extension</span>=php_pdo_sqlite.<span style="color: #000000;">dll
extension</span>=php_pgsql.<span style="color: #000000;">dll
;extension</span>=php_pspell.<span style="color: #000000;">dll
extension</span>=php_shmop.<span style="color: #000000;">dll

; The MIBS data available in the PHP distribution must be installed</span>.<span style="color: #000000;"> 
; See http</span>:<span style="color: #008000;">//</span><span style="color: #008000;">www.php.net/manual/en/snmp.installation.php </span>
;extension=php_snmp.<span style="color: #000000;">dll

;extension</span>=php_soap.<span style="color: #000000;">dll
;extension</span>=php_sockets.<span style="color: #000000;">dll
extension</span>=php_sqlite3.<span style="color: #000000;">dll
;extension</span>=php_sybase_ct.<span style="color: #000000;">dll
;extension</span>=php_tidy.<span style="color: #000000;">dll
;extension</span>=php_xmlrpc.<span style="color: #000000;">dll
;extension</span>=php_xsl.dll

?

修改date.timezone:

<span style="color: #008080;">date</span>.timezone = Asia/Shanghai

?

將apache設置為windows service方法:

到apache的bin目錄(使用管理員身份運行cmd),運行命令:

httpd.exe -k install

然后雙擊運行ApacheMonitor.exe即可。

卸載服務方法是:

httpd.exe -k uninstall

?


?

?測試

在F:\PhpProject目錄下面新建一個文件:index.php

<span style="color: #000000;">php
    </span><span style="color: #008080;">phpinfo</span><span style="color: #000000;">();
</span>?>

將看到如下:

?


?

文章參考:

Windows下搭建PHP開發(fā)環(huán)境

http://www.cnblogs.com/pharen/archive/2012/02/06/2340628.html

?

手動將Apache注冊為系統(tǒng)服務

http://www.cnblogs.com/zhenmingliu/archive/2012/01/09/2316886.html

?

Erkl?rung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

Hei?e KI -Werkzeuge

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Clothoff.io

Clothoff.io

KI-Kleiderentferner

Video Face Swap

Video Face Swap

Tauschen Sie Gesichter in jedem Video mühelos mit unserem v?llig kostenlosen KI-Gesichtstausch-Tool aus!

Hei?e Werkzeuge

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SublimeText3 chinesische Version

SublimeText3 chinesische Version

Chinesische Version, sehr einfach zu bedienen

Senden Sie Studio 13.0.1

Senden Sie Studio 13.0.1

Leistungsstarke integrierte PHP-Entwicklungsumgebung

Dreamweaver CS6

Dreamweaver CS6

Visuelle Webentwicklungstools

SublimeText3 Mac-Version

SublimeText3 Mac-Version

Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

Objektrelationszuordnung (ORM) Leistungsstimmen in PHP Objektrelationszuordnung (ORM) Leistungsstimmen in PHP Jul 29, 2025 am 05:00 AM

Vermeiden Sie N 1 Abfrageprobleme, reduzieren Sie die Anzahl der Datenbankabfragen, indem Sie die zugeh?rigen Daten im Voraus laden. 2. W?hlen Sie nur die erforderlichen Felder aus, um das Laden vollst?ndiger Entit?ten zu vermeiden, um Speicher und Bandbreite zu sparen. 3.. Verwenden Sie Cache-Strategien vernünftigerweise, z. 4. Optimieren Sie den Lebenszyklus der Entit?t und rufen Sie Clear () regelm??ig an, um den Speicher freizugeben, um den Speicherüberlauf zu verhindern. 5. Stellen Sie sicher, dass der Datenbankindex die generierten SQL -Anweisungen existiert und analysiert, um ineffiziente Abfragen zu vermeiden. 6. Deaktivieren Sie die automatische ?nderungsverfolgung in Szenarien, in denen ?nderungen nicht erforderlich sind, und verwenden Sie Arrays oder Leichtgewichtsmodi, um die Leistung zu verbessern. Die korrekte Verwendung von ORM erfordert die Kombination der SQL -überwachung, -gespeicherung, der Stapelverarbeitung und der geeigneten Optimierung, um die Anwendungsleistung zu gew?hrleisten und gleichzeitig die Entwicklungseffizienz beizubehalten.

Laravel Lazy Loading gegen eifrige Beladung Laravel Lazy Loading gegen eifrige Beladung Jul 28, 2025 am 04:23 AM

Lazy Loading nur Abfragen beim Zugriff auf Assoziationen kann leicht zu N 1 -Problemen führen, was für Szenarien geeignet ist, in denen die zugeh?rigen Daten nicht festgelegt sind, ob sie ben?tigt werden. 2. Notfallbelastung verwendet mit () zum Laden der zugeordneten Daten im Voraus, um N 1 -Abfragen zu vermeiden, was für Stapelverarbeitungsszenarien geeignet ist. 3. Die Notfallbelastung sollte zur Optimierung der Leistung verwendet werden, und n 1 Probleme k?nnen durch Tools wie LaravelDebugbar erkannt werden, und das $ mit Attribut des Modells wird sorgf?ltig verwendet, um unn?tige Leistungsaufwand zu vermeiden.

Die serverlose Revolution: Bereitstellung skalierbarer PHP -Anwendungen mit BREF Die serverlose Revolution: Bereitstellung skalierbarer PHP -Anwendungen mit BREF Jul 28, 2025 am 04:39 AM

Mit Bref erm?glicht es PHP-Entwicklern, skalierbare, kostengünstige Anwendungen zu erstellen, ohne Server zu verwalten. 1.Bref bringt Php nach AWSLambda, indem er eine optimierte PHP -Laufzeitschicht bereitstellt, Php8.3 und andere Versionen unterstützt und sich nahtlos in Frameworks wie Laravel und Symfony integriert. 2.. 3. Führen Sie den Befehl ServerlessDeploy aus, um die Bereitstellung abzuschlie?en, apiCateway automatisch zu konfigurieren und Zugriffs -URLs zu generieren. 4. Für Lambda -Beschr?nkungen bietet BREF L?sungen.

Integration von PHP in Modelle für maschinelles Lernen Integration von PHP in Modelle für maschinelles Lernen Jul 28, 2025 am 04:37 AM

UsearestapitobridgephpandmlmodelsbyrunningThemodelinpythonviaplaskorfastapiandcallingitFrompusingCurlorguzzle.2.RunpythonScriptsDirectlyfrompusexec () orshell_exec () Forsimple, Low-TrafcuStates, und Low-Trafficusecases

Ein tiefes Eintauchen in den Mechanismus für interne Müllsammlung von PHP Ein tiefes Eintauchen in den Mechanismus für interne Müllsammlung von PHP Jul 28, 2025 am 04:44 AM

Der Müllsammlung von PHP basiert auf der Referenzz?hlung, aber kreisf?rmige Referenzen müssen von einem periodischen kreisf?rmigen Müllsammler verarbeitet werden. 1. Die Referenzzahl gibt den Speicher sofort frei, wenn keine Referenz auf die Variable vorhanden ist. 2. Referenzreferenz bewirkt, dass Speicher nicht automatisch freigegeben werden kann, und es h?ngt davon ab, dass GC ihn erfasst und reinigt. 3.. GC wird ausgel?st, wenn das "m?gliche Wurzel" den Schwellenwert erreicht oder manuell gc_collect_cycles () aufruft; 4. Langzeit laufende PHP-Anwendungen sollten gc_status () überwachen und rechtzeitig gc_collect () aufrufen, um Speicherleckage zu vermeiden. 5. Zu den Best Practices geh?rt die Vermeidung von kreisf?rmigen Referenzen, die Verwendung von gc_disable () zur Optimierung der Leistungsschlüsselbereiche und Dereference -Objekte über die Clear () -Methode des ORM.

Aufbau unver?nderlicher Objekte in PHP mit Readonly -Eigenschaften Aufbau unver?nderlicher Objekte in PHP mit Readonly -Eigenschaften Jul 30, 2025 am 05:40 AM

ReadOmpropertiesinphp8.2canonlyBeSignedoncinstructororatDeklarationandCannotBemodifiedAfterward, durchsetzungsvermutbarkeitatheluagelevel.2.ToachedevimmiMmutability, WrapMutabletypesLikearrayObjecustomimmutablecollections

Beispiel für Python Memory Management Beispiel für Python Memory Management Jul 28, 2025 am 01:10 AM

Die Speicherverwaltung von Python basiert auf Referenzz?hlungen und Müllsammlungsmechanismen. 1. Der Referenzz?hlmechanismus stellt sicher, dass Objekte sofort freigegeben werden, wenn die Referenznummer 0 ist. Der Rückgabewert von sys.getrefCount () ist 1 mehr als die tats?chliche Referenz, weil er seine Referenz selbst erh?ht; 2. Kreisf?rmige Referenzen k?nnen nicht durch Referenzz?hlung gereinigt werden, und es h?ngt vom Generationsrecycling des GC -Moduls ab. Das Aufrufen von gc.collect () kann unerreichbare Objekte recyceln; 3. In der tats?chlichen Entwicklung sollten die langfristige Haltung gro?er Objektreferenzen vermieden werden. Wir k?nnen schwache Referenzen verwenden, rechtzeitig für den Speicher freigeben und Tracemalloc verwenden, um die Speicherzuweisung zu überwachen. 4. Zusammenfassung: Python kombiniert Referenzz?hlung und Müllsammlung zum Verwalten von Speicher. Entwickler k?nnen Tools verwenden und Referenzrohre optimieren.

Laravel Raw SQL Abfrage Beispiel Laravel Raw SQL Abfrage Beispiel Jul 29, 2025 am 02:59 AM

Laravel unterstützt die Verwendung nativer SQL -Abfragen, aber die Parameterbindung sollte bevorzugt werden, um die Sicherheit zu gew?hrleisten. 1. Verwenden Sie db :: select (), um Auswahlabfragen mit Parameterbindung auszuführen, um die SQL -Injektion zu verhindern. 2. Verwenden Sie db :: update (), um Aktualisierungsvorg?nge durchzuführen und die Anzahl der betroffenen Zeilen zurückzugeben. 3.. Verwenden Sie db :: Insert (), um Daten einzufinden. 4. Verwenden Sie db :: delete (), um Daten zu l?schen; 5. Verwenden Sie db :: Anweisung (), um SQL -Anweisungen ohne Ergebniss?tze wie Erstellen, Alter usw. auszuführen; 6. Es wird empfohlen, in QueryBuilder in der Lage zu verwenden, native Ausdrücke zur Verbesserung der Sicherheit zu kombinieren, um die Sicherheit zu verbessern

See all articles