在conf中加上alias,格式如下:
Alias /wap/ "E:/wap/"
wap为web访问的名字。后面的是虚拟目录的路径

解决方案 »

  1.   

    1.  php4apache2.dll is for apache2.xx
     php4apache.dll  is for apache1.xx
      

  2.   

    AddType application/x-httpd-php .php<VirtualHost 192.168.0.11>
        ServerAdmin [email protected]
        DocumentRoot D:/work/test/oversite/validate/
        ServerName 192.168.0.11
        ErrorLog logs/dummy-host.example.com-error_log
        CustomLog logs/dummy-host.example.com-access_log common
    </VirtualHost>
    <VirtualHost 192.168.0.103>
        ServerAdmin [email protected]
        DocumentRoot D:/work/test/oversite/chongqing/
        ServerName 192.168.0.103
        ErrorLog logs/192.168.0.103-error_log
        CustomLog logs/192.168.0.103-access_log common
    </VirtualHost>
      

  3.   

    以下是我的httpd.conf文件,请大侠帮我看看其中配置有什么错误!
    ServerType standaloneServerRoot "D:/Apache"PidFile logs/httpd.pidScoreBoardFile logs/apache_runtime_status#ResourceConfig conf/srm.conf
    #AccessConfig conf/access.confTimeout 300
    KeepAlive OnMaxKeepAliveRequests 100
    KeepAliveTimeout 15MaxRequestsPerChild 0
    ThreadsPerChild 50#Listen 3000
    #Listen 12.34.56.78:80#BindAddress 192.168.0.7
    #BindAddress 192.168.0.11
    #BindAddress 192.168.0.102
    BindAddress *#LoadModule php4_module D:/php/sapi/php4apache2.dll
    LoadModule php4_module d:/php/sapi/php4apache.dllClearModuleList
    #AddModule mod_vhost_alias.c
    AddModule mod_env.c
    AddModule mod_log_config.c
    #AddModule mod_mime_magic.c
    AddModule mod_mime.c
    AddModule mod_negotiation.c
    #AddModule mod_status.c
    #AddModule mod_info.c
    AddModule mod_include.c
    AddModule mod_autoindex.c
    AddModule mod_dir.c
    AddModule mod_isapi.c
    AddModule mod_cgi.c
    AddModule mod_asis.c
    AddModule mod_imap.c
    AddModule mod_actions.c
    #AddModule mod_speling.c
    AddModule mod_userdir.c
    AddModule mod_alias.c
    #AddModule mod_rewrite.c
    AddModule mod_access.c
    AddModule mod_auth.c
    #AddModule mod_auth_anon.c
    #AddModule mod_auth_dbm.c
    #AddModule mod_auth_digest.c
    #AddModule mod_digest.c
    #AddModule mod_proxy.c
    #AddModule mod_cern_meta.c
    #AddModule mod_expires.c
    #AddModule mod_headers.c
    #AddModule mod_usertrack.c
    #AddModule mod_unique_id.c
    AddModule mod_so.c
    AddModule mod_setenvif.cPort 80
    ServerAdmin [email protected]
    ServerName localhost
    DocumentRoot "D:/work"
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory "D:/work"><IfModule mod_userdir.c>
        UserDir "D:/Apache/users/"
    </IfModule>DefaultType text/plainServerSignature On    Alias /manual/ "D:/Apache/htdocs/manual/"    <Directory "D:/Apache/htdocs/manual">
            Options Indexes FollowSymlinks MultiViews
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory><VirtualHost 192.168.0.11>
        ServerAdmin [email protected]
        DocumentRoot D:/work/test/oversite/validate/
        ServerName 192.168.0.11
        ErrorLog logs/dummy-host.example.com-error_log
        CustomLog logs/dummy-host.example.com-access_log common
        AddType application/x-httpd-php .php
    </VirtualHost>ScriptAlias /php/ "d:/php/"
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .phtml
    Action application/x-httpd-php "/php/php.exe"
      

  4.   

    你要是使用CGI模式就不用载入dll模块
    两者有一个就行了.
    还有你的apache是什么版本,php4apache2.dll是为apache2专门准备的,
    如果你是apache1.3.X请使用php4apache.dll
      

  5.   

    谢谢ice_berg16兄弟!!恍然顿悟!!现在在家里,明天解决问题给分!!
      

  6.   

    绝对是Apache 1.x了,看你配置文件就可以看出来。
    稻草人说的没错,如果以模块方式执行,则需要LoadModule载入php4apache.dll模块,而不需要设置
    ScriptAlias /php/ "d:/php/"
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .phtml
    Action application/x-httpd-php "/php/php.exe"
    这是CGI方式执行PHP的设置,不推荐用CGI方式运行PHP,推荐模块方式运行
      

  7.   

    模块方式运行PHP,需要在httpd.conf中加入:LoadModule php4_module "C:/php/sapi/php4apache.dll"AddModule mod_php4.cAddType application/x-httpd-php .php
      

  8.   

    AddModule mod_php4.c   这一句很容易忘
      

  9.   

    AddModule mod_php4.c   这一句很容易忘这个是我曾经抓狂很久的一句。