当前位置:  开发笔记 > 编程语言 > 正文

BasicNetwork.performRequest:http://localhost/database/login.php的意外响应代码403

如何解决《BasicNetwork.performRequest:http://localhost/database/login.php的意外响应代码403》经验,为你挑选了1个好方法。

我正在使用Volley连接到MySql数据库.我创建了数据库表并编写了php函数,下面是java代码.所有这一切都在一直工作,但就在昨天它醒来在logcat中发出这个错误并且它没有返回任何响应,使用谷歌chrome postman测试php脚本工作得很好所以我认为我的java代码有问题.

BasicNetwork.performRequest:http://192.168.43.71/database/login.php的意外响应代码403

我知道之前曾经问过这样的几个问题,我已经完成了所有这些问题,似乎没有什么工作可做.我疯了.

private void login() {
      StringRequest jsonObjRequest = new StringRequest(Method.POST, Constants.ACCOUNTLOGIN,
              loginSuccessListener(),
              loginErrorListener()) {
      protected Map getParams() throws com.android.volley.AuthFailureError {
          Map params = new HashMap();
          params.put("user_phone_number", sPhoneNumber);
          params.put("user_password", sPassword);
          return params;
          };
      }; 
  mVolleyQueue.add(jsonObjRequest);
     }

小智.. 7

First check if you can open the same url on your mobile browser. I assume you use Apache2.4.9 webserver. If you've not changed default values for you get "denied permission". To solve this problem you need change some values in "httpd.conf" file which has Apache settings.

1- Under DocumentRoot change Directory xml tag as following:


     AllowOverride none
     Require all granted

2- Under "onlineoffline tag" update the line as following:


    ...
    ...
    ...
#   onlineoffline tag - don't remove
    Require all granted

Note: If you use older version of Apache you need google for right syntax in httpd.conf

如果这种变化有效,请告诉我.:)



1> 小智..:

First check if you can open the same url on your mobile browser. I assume you use Apache2.4.9 webserver. If you've not changed default values for you get "denied permission". To solve this problem you need change some values in "httpd.conf" file which has Apache settings.

1- Under DocumentRoot change Directory xml tag as following:


     AllowOverride none
     Require all granted

2- Under "onlineoffline tag" update the line as following:


    ...
    ...
    ...
#   onlineoffline tag - don't remove
    Require all granted

Note: If you use older version of Apache you need google for right syntax in httpd.conf

如果这种变化有效,请告诉我.:)

推荐阅读
李桂平2402851397
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有