I am new to slim. Everything works fine in my Qt app on windows, such as connection to host and routes, but as soon as i deploy the app to android i get:
QNetworkReply::NetworkError(HostNotFoundError)
But whilst still in android In the same app I can get a reply from “http://google.com”, but not “http://test/api/fruit”-which works on windows. I have only been using slim for a few weeks now and it’s great, but I have no idea what to do here. Thanks
Seems the error is not really Slim related, the issue I suspect is name resolution, the reason this may be working on Windows is because the hosts file contains the domain in question. Just a hunch.
Ok thanks but what should I do now to fix this? I assume this would be related to android device? would it be anything to do with the androidmanifest file?
I thought it was because I had not enabled my wamp server for remote access for all devices on my lan. After many posts it seems that as my wampserver is 3.0.6 (latest version) it should have been a case of editing my added virtual host for the slim api server in httpd-vhosts.conf. Something like:
<VirtualHost *:80>
ServerName test
DocumentRoot c:/wamp64/www/test/public
<Directory "c:/wamp64/www/test/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted <-- changing this from require local
Require ip 192.168.1 <-- adding this for all devices
</Directory>
</VirtualHost>
But after restarting server and typing in browser:
pc ip/test/fruit
I now get forbiden… dont have permission
but if I ‘require grant all’ to the wamp’s default virtual host, and put pc ip in android browser I can access the wamp page-- but this is not what I want
The thing is, that you have to figure out if it has anything to do with Slim, or it’s just a server-config that is bothering you.
I use laragon (also a kind of wamp thing, and runs great) with nginx these days. Perhaps something to try out?.
After days of battling with the issue, I had a similar idea and moved over to xampp, and within a few moments the problem was solved! I’m sorry for wasting your time as it had nothing to do with Slim. Slim is great