【问题标题】:localhost/xampp/ or http://localhost/index.php can't be accessedlocalhost/xampp/ 或 http://localhost/index.php 无法访问
【发布时间】:2018-01-17 04:07:10
【问题描述】:

我正在学习服务器和 sql。所以我需要安装xampp。但不幸的是,我的 localhost/index.php 和 localhost/xampp 无法正常工作。我在这里阅读了很多问题 stackoverflow 但没有一个解决我的问题。这是我的 httpd-xampp.conf 文件:

#
# XAMPP settings
#

<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
SetEnv PHPRC "\\xampp\\php"
SetEnv TMP "\\xampp\\tmp"
</IfModule>

#
# PHP-Module setup
#
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"

<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>

#
# PHP-CGI setup
#
#<FilesMatch "\.php$">
#    SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
#    Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>


<IfModule php7_module>
PHPINIDir "C:/xampp/php"
</IfModule>

<IfModule mime_module>
AddType text/html .php .phps
</IfModule>

ScriptAlias /php-cgi/ "C:/xampp/php/"
<Directory "C:/xampp/php">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
      Require all granted
</Files>
</Directory>

<Directory "C:/xampp/cgi-bin">
<FilesMatch "\.php$">
    SetHandler cgi-script
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler None
</FilesMatch>
</Directory>

<Directory "C:/xampp/htdocs/xampp">
<IfModule php7_module>
    <Files "status.php">
        php_admin_flag safe_mode off
    </Files>
</IfModule>
AllowOverride AuthConfig
</Directory>

<IfModule alias_module>
Alias /licenses "C:/xampp/licenses/"
<Directory "C:/xampp/licenses">
    Options +Indexes
    <IfModule autoindex_color_module>
        DirectoryIndexTextColor  "#000000"
        DirectoryIndexBGColor "#f8e8a0"
        DirectoryIndexLinkColor "#bb3902"
        DirectoryIndexVLinkColor "#bb3902"
        DirectoryIndexALinkColor "#bb3902"
    </IfModule>
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
   </Directory>

Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
    AllowOverride AuthConfig
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

Alias /webalizer "C:/xampp/webalizer/"[enter image description here][1]
<Directory "C:/xampp/webalizer">
    <IfModule php7_module>
        <Files "webalizer.php">
            php_admin_flag safe_mode off
        </Files>
    </IfModule>
    AllowOverride AuthConfig
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
</IfModule>

这是我尝试访问 localhost/xampp/ 和 localhost/index.php 时得到的结果

The image is here:

请提出解决方案:)

【问题讨论】:

    标签: xampp localhost


    【解决方案1】:

    尝试将此网址粘贴到您的首选网站中。

    file:///C:/xampp/htdocs
    

    您可以在网站中打开整个文件夹 View the screenshot, of how it shows, in this link

    您可以访问您想要的文件。

    【讨论】:

      猜你喜欢
      • 2015-11-10
      • 2018-06-02
      • 2016-01-22
      • 2012-10-10
      • 2010-10-07
      • 1970-01-01
      • 2017-03-02
      • 2015-11-03
      相关资源
      最近更新 更多