0

I'm trying to test my iPhone application on the device. I have a mac computer which stores my development environment. Right now I can only access PHP files using the http://localhost/PHPFileLocation which does not work when I try to test my app on real device.

How do I configure apache2 to be accessible from outside? Is it possible to configure it to a specific IP address?

I want to reach some php scripts located on my development machine running apache2 from my iPhone device.

Thanks

embedded
  • 181
  • 1
  • 2
  • 11

2 Answers2

0

If your computer has a WiFi card then you should be able to attach the iPhone remotely to a ad-hoc Wifi network created on your dev machine.

djangofan
  • 28,471
  • 61
  • 196
  • 289
0

I'm assuming your Mac is behind a router. You should be able to configure your router to port forward connections to your WAN facing IP address to port 80 (the HTTP port) on your Mac - see http://portforward.com/ for some help.

You may also need to turn the firewall off on your Mac.

Once this is set up correctly you can hit http://yourexternalIP/PHPFileLocation in your iPhone app and this will be directed by your router to the Apache2 server on your Mac. The external IP is normally found on your router's admin page somewhere.

Robert Conn
  • 877
  • 8
  • 17
  • I tried this option but no success. I noticed that even http://127.0.0.1/PHPFileLocation did not work. Only the localhost option was working... What else should I try? – embedded Mar 20 '10 at 19:05
  • This is the error message I'm getting: 404 Not Found File not found. micro_httpd Does anyone know how to resolve this? – embedded Mar 20 '10 at 21:49
  • 404 means that the Apache server is alive and your requests are getting to it. The resource (seems like a PHP file in your case) does not exist in the correct location. Check you have your code in right place. The root of the web server public area is generally the htdocs folder. – Robert Conn Mar 20 '10 at 23:45