vendredi 15 avril 2016

org.apache.http.conn.HttpHostConnectException: Connection to http://10.0.2.2:80 refused

 org.apache.http.conn.HttpHostConnectException: Connection to http://10.0.2.2:80 refused

This exception occurs when you want to invoke from your emulator an url from apache ,using for example wamp or easyphp.
To resolve it you must add 10.0.2.2 to be allowed on the file of configuration of apache server.
So go to Apache httpd.conf (located in Apache folder): and search for
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
and check if the second line is Deny, if it is then change it to:
Allow from all


1 commentaire:

  1. si vous travaillez avec apache 2.4 vous devez mettre "Require all granted"
    version 2.2 :

    Order allow,deny
    Allow from all
    version 2.4 :

    Require all granted

    more here:https://httpd.apache.org/docs/current/upgrading.html

    RépondreSupprimer