CodeIgniter Forums

Full Version: Use wamp localhost in other device
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
I cannot access to localhost(wamp) in my mobile
I try add ip to apache but i cannot use it
I search in google and find many topic about this problem but they are not helpful
If you by wamp mean WampServer 3.0 or later, you activate the "online" feature this way:
1. Left-click => Apache => httpd-vhost.conf
2. Add "Require ip 192.168.0" or whatever your ip-range are to your virtualhost for CI. 

This example are for the document root (not recommended). You should have a virtualhost for CI and have your mobile access the ServerName instead.
Code:
<VirtualHost *:80>
    ServerName localhost
    ServerAlias localhost
    DocumentRoot c:/wamp/www
    <Directory  "c:/wamp/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
        Require ip 192.168.0 #This is your ip-range
    </Directory>
</VirtualHost>
(11-05-2017, 12:28 PM)jreklund Wrote: [ -> ]If you by wamp mean WampServer 3.0 or later, you activate the "online" feature this way:
1. Left-click => Apache => httpd-vhost.conf
2. Add "Require ip 192.168.0" or whatever your ip-range are to your virtualhost for CI. 

This example are for the document root (not recommended). You should have a virtualhost for CI and have your mobile access the ServerName instead.
Code:
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory  "c:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.0 #This is your ip-range
</Directory>
</VirtualHost>

Thanks
Do you know what "localhost" means?
(11-07-2017, 08:54 AM)Narf Wrote: [ -> ]Do you know what "localhost" means?

Yes my home is localhost Confused
(11-07-2017, 11:53 AM)omid_student Wrote: [ -> ]
(11-07-2017, 08:54 AM)Narf Wrote: [ -> ]Do you know what "localhost" means?

Yes my home is localhost  Confused

Yes, your home is localhost. But so is any office PC, smartphone and literally every network-capable computer device on the planet.

localhost means "this computer" and can only be accessed by itself. If you try to access "localhost" on your smartphone, it will access the smartphone, so of course it won't get to your PC.