Reputation: 33
I developed an iPhone application which uses some PHP code and a MySQL database. To test this app in a real device, does Apple provide a webserver on iOS or not? In my code I am running PHP code using URLs like this:
http://localhost/GetUserlist.php
So, to test this in a real device, does Apple provide a webserver or not? Do we need to host our own files in our own server for this?
Please help me in this regard.
Upvotes: 0
Views: 237
Reputation: 4371
I've thought about this a dozen times already but I haven't tried anything so far. I'm pretty sure using PHP/MySQL is a no-go on an iPhone, I think you should host these files somewhere else and basically export the data in JSON or XML. Then you could use a mobile javascript framework to get the data and use it within your application.
PhoneGap is one of these frameworks, I also believe that using jQuery/jQuery Mobile can be done without any problems together with PhoneGap... Furthermore PhoneGap gives you the ability to use CSS/HTML for the design.
On the other hand: if PHP/SQL is really what you need (and thus also an internet connection), why not just create an online app/website for mobile phones? In my opinion it's only worth creating an app if you save data locally on the mobile phone to access even without a working internet connection.
Upvotes: 0
Reputation: 9912
There is no implemented web server on the iPhone and Apple does not provide such services for developers. You need to host the PHP/MySQL on your own server.
Upvotes: 2