Forbidden you don‘t have permission to access this resource Apache/2.4.46(Win64)PHP/7.3.21 Server at


/*参考

https://blog.csdn.net/A1344714150/article/details/95341261

https://bbs.csdn.net/topics/390904273?list=23494857

*/

1.用手机连接wapmserver中的apache时出现的问题(手机连接电脑这个服务器)

2.解决方法

(1)手机与电脑连接同一个wife,但是不要搞错手机应该连接的ip地址与端口号了。

用的是192.168.1.145这个ip地址,此ip地址是你连接的路由器(wife)分配给你无线网卡,产生的地址

(2)查阅博客帖子,发现这个问题常规的解决办法是修改(Apache里的)httpd.conf中的两处配置。

先将

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>


修改为

<Directory />
    Options FollowSymLinks
    AllowOverride none
    Require all granted
</Directory>

接着将

DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options +Indexes +FollowSymLinks +Multiviews
 
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
#    AllowOverride all
 
    #
    # Controls who can get stuff from this server.
    #
 
#   onlineoffline tag - don't remove
#    Require local
   AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
</Directory>

修改为

DocumentRoot "E:\wamp64\www"
<Directory "E:\wamp64\www">
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
</Directory>

之后你还需要将httpd-vhosts.conf(也是Apache中的)

<VirtualHost _default_:80>
 #DocumentRoot "${SRVROOT}/htdocs"
 DocumentRoot "d:/www"
 #ServerName www.example.com:80
 </VirtualHost>

修改为

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  #DocumentRoot "${INSTALL_DIR}/www"
DocumentRoot "E:\wamp64\www"      #主要修改红色字体部分
  <Directory "E:\wamp64\www">

    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM